Spring Security SAML

org.springframework.security.saml.context
Class SAMLContextProviderLB

java.lang.Object
  extended by org.springframework.security.saml.context.SAMLContextProviderImpl
      extended by org.springframework.security.saml.context.SAMLContextProviderLB
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean, SAMLContextProvider

public class SAMLContextProviderLB
extends SAMLContextProviderImpl

Context provider which overrides request attributes with values of the load-balancer or reverse-proxy in front of the local application. The settings help to provide correct redirect URls and verify destination URLs during SAML processing.


Field Summary
 
Fields inherited from class org.springframework.security.saml.context.SAMLContextProviderImpl
keyManager, logger, metadata, metadataResolver, pkixResolver, storageFactory
 
Constructor Summary
SAMLContextProviderLB()
           
 
Method Summary
 void afterPropertiesSet()
          Verifies that required entities were autowired or set and initializes resolvers used to construct trust engines.
protected  void populateGenericContext(HttpServletRequest request, HttpServletResponse response, SAMLMessageContext context)
          Method wraps the original request and provides values specified for load-balancer.
 void setContextPath(String contextPath)
          Context path of the LB, must be starting with slash, e.g.
 void setIncludeServerPortInRequestURL(boolean includeServerPortInRequestURL)
          When true serverPort will be used in construction of LB requestURL.
 void setScheme(String scheme)
          Scheme of the LB server - either http or https
 void setServerName(String serverName)
          Server name of the LB, e.g.
 void setServerPort(int serverPort)
          Port of the server, in case value is <= 0 port will not be included in the requestURL and port from the original request will be used for getServerPort calls.
 
Methods inherited from class org.springframework.security.saml.context.SAMLContextProviderImpl
getLocalAndPeerEntity, getLocalEntity, populateDecrypter, populateLocalContext, populateLocalEntity, populateLocalEntityId, populatePeerContext, populatePeerEntityId, populatePeerSSLCredential, populateSSLCredential, populateSSLTrustEngine, populateTrustEngine, setKeyManager, setMetadata, setStorageFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SAMLContextProviderLB

public SAMLContextProviderLB()
Method Detail

populateGenericContext

protected void populateGenericContext(HttpServletRequest request,
                                      HttpServletResponse response,
                                      SAMLMessageContext context)
                               throws org.opensaml.saml2.metadata.provider.MetadataProviderException
Method wraps the original request and provides values specified for load-balancer. The following methods are overriden: getContextPath, getRequestURL, getRequestURI, getScheme, getServerName, getServerPort and isSecure.

Overrides:
populateGenericContext in class SAMLContextProviderImpl
Parameters:
request - original request
response - response object
context - context to populate values to
Throws:
org.opensaml.saml2.metadata.provider.MetadataProviderException

setScheme

public void setScheme(String scheme)
Scheme of the LB server - either http or https

Parameters:
scheme - scheme

setServerName

public void setServerName(String serverName)
Server name of the LB, e.g. www.myserver.com

Parameters:
serverName - server name

setServerPort

public void setServerPort(int serverPort)
Port of the server, in case value is <= 0 port will not be included in the requestURL and port from the original request will be used for getServerPort calls.

Parameters:
serverPort - server port

setIncludeServerPortInRequestURL

public void setIncludeServerPortInRequestURL(boolean includeServerPortInRequestURL)
When true serverPort will be used in construction of LB requestURL.

Parameters:
includeServerPortInRequestURL - true to include port

setContextPath

public void setContextPath(String contextPath)
Context path of the LB, must be starting with slash, e.g. /saml-extension

Parameters:
contextPath - context path

afterPropertiesSet

public void afterPropertiesSet()
                        throws ServletException
Verifies that required entities were autowired or set and initializes resolvers used to construct trust engines.

Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Overrides:
afterPropertiesSet in class SAMLContextProviderImpl
Throws:
ServletException

Spring Security SAML