Interface ExternalAuthenticatorTokenRepository
- All Known Implementing Classes:
SessionBasedExternalAuthenticationRepository
public interface ExternalAuthenticatorTokenRepository
A repository used by subclasses of
AbstractUserRedirectAuthenticationProvider that needs to pick up the
tranferred RedirectForAuthenticationToken to serve as input for the user authentication. When the user
authentication is done, the completeExternalAuthentication(Authentication, HttpServletRequest) or
completeExternalAuthentication(Saml2ErrorStatusException, HttpServletRequest) method is invoked to save the
result.
Note that implementation of the ExternalAuthenticatorTokenRepository must used the same persistence strategy
as the FilterAuthenticationTokenRepository used by the Saml2UserAuthenticationProcessingFilter.
The persistence mechanism used will depend on the implementation, but most commonly the HttpSession will be
used to store the tokens.
- Author:
- Martin Lindström
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidcompleteExternalAuthentication(org.springframework.security.core.Authentication token, jakarta.servlet.http.HttpServletRequest request) Is invoken to commit theAuthenticationtoken that is the result from the external user authentication.voidcompleteExternalAuthentication(Saml2ErrorStatusException error, jakarta.servlet.http.HttpServletRequest request) Is invoken to commit theSaml2ErrorStatusExceptionthat is a description for a failed user authentication.getExternalAuthenticationToken(jakarta.servlet.http.HttpServletRequest request) Gets theRedirectForAuthenticationTokenthat is the input for an external authentication process.
-
Method Details
-
getExternalAuthenticationToken
RedirectForAuthenticationToken getExternalAuthenticationToken(jakarta.servlet.http.HttpServletRequest request) Gets theRedirectForAuthenticationTokenthat is the input for an external authentication process.- Parameters:
request- the HTTP servlet request- Returns:
- the
RedirectForAuthenticationTokenornullif not present
-
completeExternalAuthentication
void completeExternalAuthentication(org.springframework.security.core.Authentication token, jakarta.servlet.http.HttpServletRequest request) throws IllegalStateException Is invoken to commit theAuthenticationtoken that is the result from the external user authentication.- Parameters:
token- theAuthenticationtokenrequest- the current HTTP request- Throws:
IllegalStateException- if the correspondingRedirectForAuthenticationTokenis not available in the repository
-
completeExternalAuthentication
void completeExternalAuthentication(Saml2ErrorStatusException error, jakarta.servlet.http.HttpServletRequest request) throws IllegalStateException Is invoken to commit theSaml2ErrorStatusExceptionthat is a description for a failed user authentication.- Parameters:
error- the errorrequest- the current HTTP request- Throws:
IllegalStateException- if the correspondingRedirectForAuthenticationTokenis not available in the repository
-