Class AbstractUserAuthenticationProvider
java.lang.Object
se.swedenconnect.spring.saml.idp.authentication.provider.AbstractUserAuthenticationProvider
- All Implemented Interfaces:
org.springframework.security.authentication.AuthenticationProvider
,UserAuthenticationProvider
- Direct Known Subclasses:
AbstractUserRedirectAuthenticationProvider
public abstract class AbstractUserAuthenticationProvider
extends Object
implements UserAuthenticationProvider
Abstract base class for
UserAuthenticationProvider
.- Author:
- Martin Lindström
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Saml2UserAuthentication
applySso
(Saml2UserAuthenticationInputToken token, List<String> authnContextUris) Applies the rules for re-using authentication, i.e., SSO.protected abstract org.springframework.security.core.Authentication
authenticate
(Saml2UserAuthenticationInputToken token, List<String> authnContextUris) Authenticates the user (after the necessary checks have been made).org.springframework.security.core.Authentication
Performs the user authentication.Given the requested authentication context URI:s, the method filters out those that are supported by theAuthenticationProvider
.Returns a modifiable list of the installedSsoVoter
s.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface se.swedenconnect.spring.saml.idp.authentication.provider.UserAuthenticationProvider
authenticate, getEntityCategories, getName, getSupportedAuthnContextUris, supports
-
Constructor Details
-
AbstractUserAuthenticationProvider
public AbstractUserAuthenticationProvider()Constructor.
-
-
Method Details
-
authenticateUser
public org.springframework.security.core.Authentication authenticateUser(Saml2UserAuthenticationInputToken token) throws Saml2ErrorStatusException Performs the user authentication.- Specified by:
authenticateUser
in interfaceUserAuthenticationProvider
- Parameters:
token
- the input token- Returns:
- the authentication token or
null
if the requested authentication context(s) can not be met by the authentication provider. - Throws:
Saml2ErrorStatusException
- for authentication errors
-
authenticate
protected abstract org.springframework.security.core.Authentication authenticate(Saml2UserAuthenticationInputToken token, List<String> authnContextUris) throws Saml2ErrorStatusException Authenticates the user (after the necessary checks have been made).- Parameters:
token
- the input tokenauthnContextUris
- the possible authentication context URI:s- Returns:
- an authentication token
- Throws:
Saml2ErrorStatusException
- for authentication errors
-
applySso
protected Saml2UserAuthentication applySso(Saml2UserAuthenticationInputToken token, List<String> authnContextUris) Applies the rules for re-using authentication, i.e., SSO. If a previous authentication may be re-used itsSaml2UserAuthentication
is returned. Otherwisenull
.- Parameters:
token
- theSaml2UserAuthenticationInputToken
authnContextUris
- filtered authentication context URI:s that are allowed- Returns:
- a
Saml2UserAuthenticationInputToken
for SSO andnull
otherwise
-
filterRequestedAuthnContextUris
Given the requested authentication context URI:s, the method filters out those that are supported by theAuthenticationProvider
. If no authentication context URI:s are requested the method returnsUserAuthenticationProvider.getSupportedAuthnContextUris()
.- Parameters:
token
- theSaml2UserAuthenticationInputToken
- Returns:
- a filtered list of possible authentication context URI:s (may be empty)
-
ssoVoters
Returns a modifiable list of the installedSsoVoter
s.- Returns:
- a modifiable list of the installed
SsoVoter
s
-