public abstract class AbstractAuthenticationManager
extends java.lang.Object
implements org.apereo.cas.authentication.AuthenticationManager
AbstractAuthenticationManager, which provides common operations
around an authentication manager implementation.| Modifier and Type | Field and Description |
|---|---|
protected org.apereo.cas.authentication.AuthenticationEventExecutionPlan |
authenticationEventExecutionPlan
Plan to execute the authentication transaction.
|
protected org.apereo.cas.authentication.AuthenticationHandlerResolver |
authenticationHandlerResolver
The Authentication handler resolver.
|
protected boolean |
principalResolutionFailureFatal
Indicate if principal resolution should totally fail
and no fall back onto principal that is produced by the
authentication handler.
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractAuthenticationManager(org.apereo.cas.authentication.AuthenticationEventExecutionPlan authenticationEventExecutionPlan,
org.apereo.cas.authentication.AuthenticationHandlerResolver authenticationHandlerResolver,
boolean principalResolutionFatal)
Creates a new authentication manager with a map of authentication handlers to the principal resolvers that
should be used upon successful authentication if no principal is resolved by the authentication handler.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addAuthenticationMethodAttribute(org.apereo.cas.authentication.AuthenticationBuilder builder,
org.apereo.cas.authentication.Authentication authentication)
Add authentication method attribute.
|
org.apereo.cas.authentication.Authentication |
authenticate(org.apereo.cas.authentication.AuthenticationTransaction transaction) |
protected void |
authenticateAndResolvePrincipal(org.apereo.cas.authentication.AuthenticationBuilder builder,
org.apereo.cas.authentication.Credential credential,
org.apereo.cas.authentication.principal.PrincipalResolver resolver,
org.apereo.cas.authentication.AuthenticationHandler handler)
Authenticate and resolve principal.
|
protected abstract org.apereo.cas.authentication.AuthenticationBuilder |
authenticateInternal(org.apereo.cas.authentication.AuthenticationTransaction transaction)
Follows the same contract as
AuthenticationManager.authenticate(AuthenticationTransaction). |
protected java.util.Set<org.apereo.cas.authentication.AuthenticationHandler> |
getAuthenticationHandlersForThisTransaction(org.apereo.cas.authentication.AuthenticationTransaction transaction)
Gets authentication handlers for this transaction.
|
protected java.util.Collection<org.apereo.cas.authentication.AuthenticationMetaDataPopulator> |
getAuthenticationMetadataPopulatorsForTransaction(org.apereo.cas.authentication.AuthenticationTransaction transaction)
Gets authentication metadata populators for transaction.
|
protected org.apereo.cas.authentication.principal.PrincipalResolver |
getPrincipalResolverLinkedToHandlerIfAny(org.apereo.cas.authentication.AuthenticationHandler handler,
org.apereo.cas.authentication.AuthenticationTransaction transaction)
Gets principal resolver linked to the handler if any.
|
protected void |
populateAuthenticationMetadataAttributes(org.apereo.cas.authentication.AuthenticationBuilder builder,
org.apereo.cas.authentication.AuthenticationTransaction transaction)
Populate authentication metadata attributes.
|
protected void |
publishEvent(org.springframework.context.ApplicationEvent event)
Publish event.
|
protected org.apereo.cas.authentication.principal.Principal |
resolvePrincipal(org.apereo.cas.authentication.AuthenticationHandler handler,
org.apereo.cas.authentication.principal.PrincipalResolver resolver,
org.apereo.cas.authentication.Credential credential,
org.apereo.cas.authentication.principal.Principal principal)
Resolve principal.
|
protected final org.apereo.cas.authentication.AuthenticationEventExecutionPlan authenticationEventExecutionPlan
protected final org.apereo.cas.authentication.AuthenticationHandlerResolver authenticationHandlerResolver
protected boolean principalResolutionFailureFatal
protected AbstractAuthenticationManager(org.apereo.cas.authentication.AuthenticationEventExecutionPlan authenticationEventExecutionPlan,
org.apereo.cas.authentication.AuthenticationHandlerResolver authenticationHandlerResolver,
boolean principalResolutionFatal)
LinkedHashMap) should be used.authenticationEventExecutionPlan - Describe the execution plan for this managerauthenticationHandlerResolver - the authentication handler resolverprincipalResolutionFatal - the principal resolution fatalprotected void populateAuthenticationMetadataAttributes(org.apereo.cas.authentication.AuthenticationBuilder builder,
org.apereo.cas.authentication.AuthenticationTransaction transaction)
builder - the buildertransaction - the transactionprotected void addAuthenticationMethodAttribute(org.apereo.cas.authentication.AuthenticationBuilder builder,
org.apereo.cas.authentication.Authentication authentication)
builder - the builderauthentication - the authenticationprotected org.apereo.cas.authentication.principal.Principal resolvePrincipal(org.apereo.cas.authentication.AuthenticationHandler handler,
org.apereo.cas.authentication.principal.PrincipalResolver resolver,
org.apereo.cas.authentication.Credential credential,
org.apereo.cas.authentication.principal.Principal principal)
handler - the handler nameresolver - the resolvercredential - the credentialprincipal - the current authenticated principal from a handler, if any.@Timed(name="AUTHENTICATE_TIMER")
@Metered(name="AUTHENTICATE_METER")
@Counted(name="AUTHENTICATE_COUNT",
monotonic=true)
public org.apereo.cas.authentication.Authentication authenticate(org.apereo.cas.authentication.AuthenticationTransaction transaction)
throws org.apereo.cas.authentication.AuthenticationException
authenticate in interface org.apereo.cas.authentication.AuthenticationManagerorg.apereo.cas.authentication.AuthenticationExceptionprotected void authenticateAndResolvePrincipal(org.apereo.cas.authentication.AuthenticationBuilder builder,
org.apereo.cas.authentication.Credential credential,
org.apereo.cas.authentication.principal.PrincipalResolver resolver,
org.apereo.cas.authentication.AuthenticationHandler handler)
throws java.security.GeneralSecurityException,
org.apereo.cas.authentication.PreventedException
builder - the buildercredential - the credentialresolver - the resolverhandler - the handlerjava.security.GeneralSecurityException - the general security exceptionPreventedException - the prevented exceptionprotected abstract org.apereo.cas.authentication.AuthenticationBuilder authenticateInternal(org.apereo.cas.authentication.AuthenticationTransaction transaction)
throws org.apereo.cas.authentication.AuthenticationException
AuthenticationManager.authenticate(AuthenticationTransaction).transaction - the authentication transactionAuthenticationException - When one or more credentials failed authentication such that security policy was not satisfied.protected java.util.Set<org.apereo.cas.authentication.AuthenticationHandler> getAuthenticationHandlersForThisTransaction(org.apereo.cas.authentication.AuthenticationTransaction transaction)
transaction - the transactionprotected org.apereo.cas.authentication.principal.PrincipalResolver getPrincipalResolverLinkedToHandlerIfAny(org.apereo.cas.authentication.AuthenticationHandler handler,
org.apereo.cas.authentication.AuthenticationTransaction transaction)
handler - the handlertransaction - the transactionprotected java.util.Collection<org.apereo.cas.authentication.AuthenticationMetaDataPopulator> getAuthenticationMetadataPopulatorsForTransaction(org.apereo.cas.authentication.AuthenticationTransaction transaction)
transaction - the transactionprotected void publishEvent(org.springframework.context.ApplicationEvent event)
event - the event