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 TypeMethodDescriptionvoid
completeExternalAuthentication
(org.springframework.security.core.Authentication token, jakarta.servlet.http.HttpServletRequest request) Is invoken to commit theAuthentication
token that is the result from the external user authentication.void
completeExternalAuthentication
(Saml2ErrorStatusException error, jakarta.servlet.http.HttpServletRequest request) Is invoken to commit theSaml2ErrorStatusException
that is a description for a failed user authentication.getExternalAuthenticationToken
(jakarta.servlet.http.HttpServletRequest request) Gets theRedirectForAuthenticationToken
that is the input for an external authentication process.
-
Method Details
-
getExternalAuthenticationToken
RedirectForAuthenticationToken getExternalAuthenticationToken(jakarta.servlet.http.HttpServletRequest request) Gets theRedirectForAuthenticationToken
that is the input for an external authentication process.- Parameters:
request
- the HTTP servlet request- Returns:
- the
RedirectForAuthenticationToken
ornull
if not present
-
completeExternalAuthentication
void completeExternalAuthentication(org.springframework.security.core.Authentication token, jakarta.servlet.http.HttpServletRequest request) throws IllegalStateException Is invoken to commit theAuthentication
token that is the result from the external user authentication.- Parameters:
token
- theAuthentication
tokenrequest
- the current HTTP request- Throws:
IllegalStateException
- if the correspondingRedirectForAuthenticationToken
is not available in the repository
-
completeExternalAuthentication
void completeExternalAuthentication(Saml2ErrorStatusException error, jakarta.servlet.http.HttpServletRequest request) throws IllegalStateException Is invoken to commit theSaml2ErrorStatusException
that is a description for a failed user authentication.- Parameters:
error
- the errorrequest
- the current HTTP request- Throws:
IllegalStateException
- if the correspondingRedirectForAuthenticationToken
is not available in the repository
-