Interface AuthenticationProcessor
-
public interface AuthenticationProcessor
Utility methods processing results of authenticators.- Author:
- K. Benedyczak
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
checkIfUserHasCredential(pl.edu.icm.unity.types.authn.AuthenticatorInstanceMetadata authn, long entityId)
static java.util.List<SessionParticipant>
extractParticipants(AuthenticationResult... results)
Extracts and returns all remoteSessionParticipant
s from theAuthenticationResult
s.AuthenticatedEntity
finalizeAfterPrimaryAuthentication(PartialAuthnState state, boolean skipSecondFactor)
Should be used if the second step authentication is not required: retrieve a finalAuthenticatedEntity
.AuthenticatedEntity
finalizeAfterSecondaryAuthentication(PartialAuthnState state, AuthenticationResult result2)
Should be used if the second step authentication is required to process second authenticator results and retrieve a finalAuthenticatedEntity
.AuthenticatorInstance
getValidAuthenticatorForEntity(java.util.Collection<AuthenticatorInstance> pool, long entityId)
PartialAuthnState
processPrimaryAuthnResult(AuthenticationResult result, AuthenticationFlow authenticationFlow, java.lang.String authnOptionId)
Starting point: the result of the primary authenticator is verified.
-
-
-
Method Detail
-
getValidAuthenticatorForEntity
AuthenticatorInstance getValidAuthenticatorForEntity(java.util.Collection<AuthenticatorInstance> pool, long entityId)
- Returns:
- authenticator which is valid for the given entity from the given pool
-
checkIfUserHasCredential
boolean checkIfUserHasCredential(pl.edu.icm.unity.types.authn.AuthenticatorInstanceMetadata authn, long entityId)
- Returns:
- true only if user can use the given authenticator. Works well (currently) only for local authenticators
-
processPrimaryAuthnResult
PartialAuthnState processPrimaryAuthnResult(AuthenticationResult result, AuthenticationFlow authenticationFlow, java.lang.String 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
static java.util.List<SessionParticipant> extractParticipants(AuthenticationResult... results) throws AuthenticationException
Extracts and returns all remoteSessionParticipant
s from theAuthenticationResult
s.- Parameters:
results
-- Returns:
- Throws:
AuthenticationException
-
-