|
Spring Security SAML | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.web.filter.GenericFilterBean
org.springframework.security.saml.SAMLDiscovery
public class SAMLDiscovery
Filter implements Identity Provider Discovery Service as defined in initializes IDP Discovery Profile as defined in http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-idp-discovery.pdf.
Field Summary | |
---|---|
protected SAMLContextProvider |
contextProvider
Context provider. |
static String |
ENTITY_ID_PARAM
Unique identifier of the party performing the request. |
static String |
FILTER_URL
Default name of path suffix which will invoke this filter. |
protected String |
filterProcessesUrl
Url this filter should get activated on. |
static String |
IDP_DISCO_PROTOCOL_SINGLE
Default profile of the discovery service. |
protected String |
idpSelectionPath
In case this property is set to not null value the user will be redirected to this URL for selection of IDP to use for login. |
protected static org.slf4j.Logger |
logger
|
protected MetadataManager |
metadata
Metadata manager used to look up entity IDs and discovery URLs. |
static String |
PASSIVE_PARAM
Request parameter indicating whether discovery service can interact with the user agent. |
static String |
POLICY_PARAM
Policy to use in order to determine IDP. |
static String |
RETURN_ID_PARAM
Request parameter specifying which response attribute to use for conveying the determined IDP name. |
static String |
RETURN_PARAM
Used to store return parameter in the forwarded request object. |
static String |
RETURN_URL
Used to store return URL in the forwarded request object. |
static String |
RETURN_URL_PARAM
URL used by the discovery service to send the response. |
protected SAMLEntryPoint |
samlEntryPoint
Entry point dependency for loading of correct URL. |
Constructor Summary | |
---|---|
SAMLDiscovery()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
Verifies that required entities were autowired or set. |
void |
doFilter(ServletRequest request,
ServletResponse response,
FilterChain chain)
|
protected String |
getDefaultReturnURL(SAMLMessageContext messageContext)
Provides default return URL based on metadata in case none was supplied in the request. |
String |
getFilterProcessesUrl()
|
String |
getIdpSelectionPath()
Path used to forward request in order to enable target IDP selection |
protected String |
getPassiveIDP(HttpServletRequest request)
Returns IDP to be used in passive mode. |
protected boolean |
isResponseURLValid(String returnURL,
SAMLMessageContext messageContext)
Verifies whether return URL supplied in the request is valid. |
protected void |
processDiscoveryRequest(HttpServletRequest request,
HttpServletResponse response)
Method processes IDP Discovery request, validates it for conformity and either sends a passive response with default IDP (when isPassive mode is requested) or forwards browser to the IDP selection. |
protected boolean |
processFilter(HttpServletRequest request)
The filter will be used in case the URL of the request contains the FILTER_URL. |
protected void |
sendIDPSelection(HttpServletRequest request,
HttpServletResponse response,
String responseURL,
String returnParam)
Forward the request to a page which renders IDP selection page for the user. |
protected void |
sendPassiveResponse(HttpServletRequest request,
HttpServletResponse response,
String responseURL,
String returnParam,
String entityID)
Creates a URL to be used for returning of the selected IDP and sends a redirect. |
void |
setContextProvider(SAMLContextProvider contextProvider)
Sets entity responsible for populating local entity context data. |
void |
setFilterProcessesUrl(String filterProcessesUrl)
Custom filter URL which overrides the default. |
void |
setIdpSelectionPath(String idpSelectionPath)
Sets path where request dispatcher will send user for IDP selection. |
void |
setMetadata(MetadataManager metadata)
Metadata manager, cannot be null, must be set. |
void |
setSamlEntryPoint(SAMLEntryPoint samlEntryPoint)
Dependency for loading of entry point URL |
Methods inherited from class org.springframework.web.filter.GenericFilterBean |
---|
addRequiredProperty, destroy, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setServletContext |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final org.slf4j.Logger logger
public static final String RETURN_URL
public static final String RETURN_PARAM
public static final String ENTITY_ID_PARAM
public static final String RETURN_URL_PARAM
public static final String RETURN_ID_PARAM
public static final String POLICY_PARAM
public static final String PASSIVE_PARAM
protected String idpSelectionPath
protected MetadataManager metadata
protected SAMLContextProvider contextProvider
protected SAMLEntryPoint samlEntryPoint
protected String filterProcessesUrl
public static final String FILTER_URL
public static final String IDP_DISCO_PROTOCOL_SINGLE
Constructor Detail |
---|
public SAMLDiscovery()
Method Detail |
---|
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException
IOException
ServletException
protected boolean processFilter(HttpServletRequest request)
request
- request used to determine whether to enable this filter
protected void processDiscoveryRequest(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
request
- requestresponse
- response
ServletException
- error
IOException
- io errorprotected void sendPassiveResponse(HttpServletRequest request, HttpServletResponse response, String responseURL, String returnParam, String entityID) throws IOException, ServletException
request
- request objectresponse
- response objectresponseURL
- base for the return URLreturnParam
- parameter name to send the IDP entityId inentityID
- entity ID to send or null for fail state
IOException
- in case redirect sending fails
ServletException
- in case redirect sending failsprotected void sendIDPSelection(HttpServletRequest request, HttpServletResponse response, String responseURL, String returnParam) throws IOException, ServletException
request
- request objectresponse
- response objectresponseURL
- base for the return URLreturnParam
- parameter name to send the IDP entityId in
IOException
- in case forwarding to the selection page fails
ServletException
- in case forwarding to the selection page failsprotected String getDefaultReturnURL(SAMLMessageContext messageContext)
messageContext
- context for the local SP
org.opensaml.common.SAMLRuntimeException
- in case entity is remote and doesn't contain URL in metadataprotected boolean isResponseURLValid(String returnURL, SAMLMessageContext messageContext)
returnURL
- URL from the requestmessageContext
- message context for current SP
protected String getPassiveIDP(HttpServletRequest request)
request
- IDP discovery request
public String getIdpSelectionPath()
public void setIdpSelectionPath(String idpSelectionPath)
idpSelectionPath
- selection path@Autowired public void setMetadata(MetadataManager metadata)
metadata
- manager@Autowired(required=false) public void setSamlEntryPoint(SAMLEntryPoint samlEntryPoint)
samlEntryPoint
- @Autowired public void setContextProvider(SAMLContextProvider contextProvider)
contextProvider
- provider implementationpublic String getFilterProcessesUrl()
public void setFilterProcessesUrl(String filterProcessesUrl)
filterProcessesUrl
- filter URLpublic void afterPropertiesSet() throws ServletException
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
afterPropertiesSet
in class org.springframework.web.filter.GenericFilterBean
ServletException
|
Spring Security SAML | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |