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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Saml2UserAuthenticationapplySso(Saml2UserAuthenticationInputToken token, List<String> authnContextUris) Applies the rules for re-using authentication, i.e., SSO.protected abstract org.springframework.security.core.Authenticationauthenticate(Saml2UserAuthenticationInputToken token, List<String> authnContextUris) Authenticates the user (after the necessary checks have been made).org.springframework.security.core.AuthenticationPerforms 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 installedSsoVoters.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
authenticateUserin interfaceUserAuthenticationProvider- Parameters:
token- the input token- Returns:
- the authentication token or
nullif 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 itsSaml2UserAuthenticationis returned. Otherwisenull.- Parameters:
token- theSaml2UserAuthenticationInputTokenauthnContextUris- filtered authentication context URI:s that are allowed- Returns:
- a
Saml2UserAuthenticationInputTokenfor SSO andnullotherwise
-
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 installedSsoVoters.- Returns:
- a modifiable list of the installed
SsoVoters
-