Interface AuthenticationProcessor
public interface AuthenticationProcessor
Utility methods processing results of authenticators.
- Author:
- K. Benedyczak
-
Method Summary
Modifier and TypeMethodDescriptionboolean
checkIfUserHasCredential
(AuthenticatorInstanceMetadata authn, long entityId) static List<SessionParticipant>
extractParticipants
(AuthenticationResult... results) Extracts and returns all remoteSessionParticipant
s from theAuthenticationResult
s.finalizeAfterPrimaryAuthentication
(PartialAuthnState state, boolean skipSecondFactor) Should be used if the second step authentication is not required: retrieve a finalAuthenticatedEntity
.Should be used if the second step authentication is required to process second authenticator results and retrieve a finalAuthenticatedEntity
.getValidAuthenticatorForEntity
(Collection<AuthenticatorInstance> pool, long entityId) processPrimaryAuthnResult
(AuthenticationResult result, AuthenticationFlow authenticationFlow, pl.edu.icm.unity.base.authn.AuthenticationOptionKey authnOptionId) Starting point: the result of the primary authenticator is verified.
-
Method Details
-
getValidAuthenticatorForEntity
AuthenticatorInstance getValidAuthenticatorForEntity(Collection<AuthenticatorInstance> pool, long entityId) - Returns:
- authenticator which is valid for the given entity from the given pool
-
checkIfUserHasCredential
- Returns:
- true only if user can use the given authenticator. Works well (currently) only for local authenticators
-
processPrimaryAuthnResult
PartialAuthnState processPrimaryAuthnResult(AuthenticationResult result, AuthenticationFlow authenticationFlow, pl.edu.icm.unity.base.authn.AuthenticationOptionKey authnOptionId) throws AuthenticationException Starting point: the result of the primary authenticator is verified. If the authentication failed then an exception is thrown. Otherwise it is checked whether, according to theAuthenticationFlow
selected, second authentication should be performed, what is returned.- Throws:
AuthenticationException
-
finalizeAfterPrimaryAuthentication
AuthenticatedEntity finalizeAfterPrimaryAuthentication(PartialAuthnState state, boolean skipSecondFactor) Should be used if the second step authentication is not required: retrieve a finalAuthenticatedEntity
. -
finalizeAfterSecondaryAuthentication
AuthenticatedEntity finalizeAfterSecondaryAuthentication(PartialAuthnState state, AuthenticationResult result2) throws AuthenticationException Should be used if the second step authentication is required to process second authenticator results and retrieve a finalAuthenticatedEntity
.- Parameters:
primaryResult
-- Returns:
- Throws:
AuthenticationException
-
extractParticipants
Extracts and returns all remoteSessionParticipant
s from theAuthenticationResult
s.
-