public class OpenIDAuthenticationFilter extends AbstractAuthenticationProcessingFilter
The OpenID authentication involves two stages.
OpenIDAuthenticationProvider| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_CLAIMED_IDENTITY_FIELD |
authenticationDetailsSource, eventPublisher, messages, SPRING_SECURITY_LAST_EXCEPTION_KEYlogger| Constructor and Description |
|---|
OpenIDAuthenticationFilter() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
Authentication |
attemptAuthentication(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Authentication has two phases.
|
protected String |
buildReturnToUrl(javax.servlet.http.HttpServletRequest request)
Builds the return_to URL that will be sent to the OpenID service provider.
|
protected String |
lookupRealm(String returnToUrl) |
protected String |
obtainUsername(javax.servlet.http.HttpServletRequest req)
Reads the claimedIdentityFieldName from the submitted request.
|
void |
setClaimedIdentityFieldName(String claimedIdentityFieldName)
The name of the request parameter containing the OpenID identity, as submitted from the initial login form.
|
void |
setConsumer(OpenIDConsumer consumer) |
void |
setRealmMapping(Map<String,String> realmMapping)
Maps the return_to url to a realm, for example:
|
void |
setReturnToUrlParameters(Set<String> returnToUrlParameters)
Specifies any extra parameters submitted along with the identity field which should be appended to the
return_to URL which is assembled by buildReturnToUrl(javax.servlet.http.HttpServletRequest). |
doFilter, getAllowSessionCreation, getAuthenticationManager, getFailureHandler, getFilterProcessesUrl, getRememberMeServices, getSuccessHandler, requiresAuthentication, setAllowSessionCreation, setApplicationEventPublisher, setAuthenticationDetailsSource, setAuthenticationFailureHandler, setAuthenticationManager, setAuthenticationSuccessHandler, setContinueChainBeforeSuccessfulAuthentication, setFilterProcessesUrl, setMessageSource, setRememberMeServices, setRequiresAuthenticationRequestMatcher, setSessionAuthenticationStrategy, successfulAuthentication, successfulAuthentication, unsuccessfulAuthenticationaddRequiredProperty, destroy, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContextpublic static final String DEFAULT_CLAIMED_IDENTITY_FIELD
public void afterPropertiesSet()
afterPropertiesSet in interface InitializingBeanafterPropertiesSet in class AbstractAuthenticationProcessingFilterpublic Authentication attemptAuthentication(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws AuthenticationException, IOException
attemptAuthentication in class AbstractAuthenticationProcessingFilterrequest - from which to extract parameters and perform the authenticationresponse - the response, which may be needed if the implementation has to do a redirect as part of a
multi-stage authentication process (such as OpenID).AuthenticationException - if authentication fails.IOExceptionprotected String buildReturnToUrl(javax.servlet.http.HttpServletRequest request)
request - the current request which is being processed by this filterprotected String obtainUsername(javax.servlet.http.HttpServletRequest req)
public void setRealmMapping(Map<String,String> realmMapping)
http://www.example.com/j_spring_openid_security_check -> http://www.example.com/realmIf no mapping is provided then the returnToUrl will be parsed to extract the protocol, hostname and port followed by a trailing slash. This means that http://www.example.com/j_spring_openid_security_check will automatically become http://www.example.com:80/
realmMapping - containing returnToUrl -> realm mappingspublic void setClaimedIdentityFieldName(String claimedIdentityFieldName)
claimedIdentityFieldName - defaults to "openid_identifier"public void setConsumer(OpenIDConsumer consumer)
public void setReturnToUrlParameters(Set<String> returnToUrlParameters)
return_to URL which is assembled by buildReturnToUrl(javax.servlet.http.HttpServletRequest).returnToUrlParameters - the set of parameter names. If not set, it will default to the parameter name used by the
RememberMeServices obtained from the parent class (if one is set).