public class PolicyBasedAuthenticationManager
extends java.lang.Object
implements org.apereo.cas.authentication.AuthenticationManager
PolicyBasedAuthenticationManager, 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 java.util.Collection<org.apereo.cas.authentication.AuthenticationPolicy> |
authenticationPolicies
Authentication security policy.
|
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 |
PolicyBasedAuthenticationManager(org.apereo.cas.authentication.AuthenticationEventExecutionPlan authenticationEventExecutionPlan,
org.apereo.cas.authentication.AuthenticationHandlerResolver authenticationHandlerResolver,
java.util.Collection<org.apereo.cas.authentication.AuthenticationPolicy> authenticationPolicies)
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.
|
|
PolicyBasedAuthenticationManager(org.apereo.cas.authentication.AuthenticationEventExecutionPlan authenticationEventExecutionPlan,
org.apereo.cas.authentication.AuthenticationHandlerResolver authenticationHandlerResolver,
java.util.Collection<org.apereo.cas.authentication.AuthenticationPolicy> authenticationPolicies,
boolean principalResolutionFatal)
Instantiates a new Policy based authentication manager.
|
|
PolicyBasedAuthenticationManager(org.apereo.cas.authentication.AuthenticationEventExecutionPlan authenticationEventExecutionPlan,
org.apereo.cas.services.ServicesManager servicesManager)
Instantiates a new Policy based authentication manager.
|
|
PolicyBasedAuthenticationManager(org.apereo.cas.authentication.AuthenticationEventExecutionPlan authenticationEventExecutionPlan,
org.apereo.cas.services.ServicesManager servicesManager,
org.apereo.cas.authentication.AuthenticationPolicy policy) |
|
PolicyBasedAuthenticationManager(org.apereo.cas.authentication.AuthenticationEventExecutionPlan authenticationEventExecutionPlan,
org.apereo.cas.services.ServicesManager servicesManager,
java.util.Collection<org.apereo.cas.authentication.AuthenticationPolicy> authenticationPolicy)
Instantiates a new Policy based authentication manager.
|
| 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 org.apereo.cas.authentication.AuthenticationBuilder |
authenticateInternal(org.apereo.cas.authentication.AuthenticationTransaction transaction)
Authenticate internal authentication builder.
|
protected org.apache.commons.lang3.tuple.Pair<java.lang.Boolean,java.util.Set<java.lang.Throwable>> |
evaluateAuthenticationPolicies(org.apereo.cas.authentication.Authentication authentication)
Evaluate authentication policies.
|
protected void |
evaluateFinalAuthentication(org.apereo.cas.authentication.AuthenticationBuilder builder,
org.apereo.cas.authentication.AuthenticationTransaction transaction)
Evaluate produced authentication context.
|
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 |
handleAuthenticationException(java.lang.Throwable e,
java.lang.String name,
org.apereo.cas.authentication.AuthenticationBuilder builder)
Handle authentication exception.
|
protected void |
invokeAuthenticationPostProcessors(org.apereo.cas.authentication.AuthenticationBuilder builder,
org.apereo.cas.authentication.AuthenticationTransaction transaction)
Populate authentication metadata attributes.
|
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 java.util.Collection<org.apereo.cas.authentication.AuthenticationPolicy> authenticationPolicies
protected PolicyBasedAuthenticationManager(org.apereo.cas.authentication.AuthenticationEventExecutionPlan authenticationEventExecutionPlan,
org.apereo.cas.authentication.AuthenticationHandlerResolver authenticationHandlerResolver,
java.util.Collection<org.apereo.cas.authentication.AuthenticationPolicy> authenticationPolicies)
LinkedHashMap) should be used.authenticationEventExecutionPlan - Describe the execution plan for this managerauthenticationHandlerResolver - the authentication handler resolverauthenticationPolicies - the authentication policiespublic PolicyBasedAuthenticationManager(org.apereo.cas.authentication.AuthenticationEventExecutionPlan authenticationEventExecutionPlan,
org.apereo.cas.authentication.AuthenticationHandlerResolver authenticationHandlerResolver,
java.util.Collection<org.apereo.cas.authentication.AuthenticationPolicy> authenticationPolicies,
boolean principalResolutionFatal)
authenticationEventExecutionPlan - the execution planauthenticationHandlerResolver - the authentication handler resolverauthenticationPolicies - the authentication policyprincipalResolutionFatal - the principal resolution fatalpublic PolicyBasedAuthenticationManager(org.apereo.cas.authentication.AuthenticationEventExecutionPlan authenticationEventExecutionPlan,
org.apereo.cas.services.ServicesManager servicesManager,
java.util.Collection<org.apereo.cas.authentication.AuthenticationPolicy> authenticationPolicy)
authenticationEventExecutionPlan - the authentication event execution planservicesManager - the services managerauthenticationPolicy - the authentication policypublic PolicyBasedAuthenticationManager(org.apereo.cas.authentication.AuthenticationEventExecutionPlan authenticationEventExecutionPlan,
org.apereo.cas.services.ServicesManager servicesManager)
authenticationEventExecutionPlan - the authentication event execution planservicesManager - the services managerpublic PolicyBasedAuthenticationManager(org.apereo.cas.authentication.AuthenticationEventExecutionPlan authenticationEventExecutionPlan,
org.apereo.cas.services.ServicesManager servicesManager,
org.apereo.cas.authentication.AuthenticationPolicy policy)
protected void invokeAuthenticationPostProcessors(org.apereo.cas.authentication.AuthenticationBuilder builder,
org.apereo.cas.authentication.AuthenticationTransaction transaction)
builder - the buildertransaction - the transactionprotected 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 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 eventprotected org.apereo.cas.authentication.AuthenticationBuilder authenticateInternal(org.apereo.cas.authentication.AuthenticationTransaction transaction)
throws org.apereo.cas.authentication.AuthenticationException
transaction - the transactionAuthenticationException - the authentication exceptionprotected void evaluateFinalAuthentication(org.apereo.cas.authentication.AuthenticationBuilder builder,
org.apereo.cas.authentication.AuthenticationTransaction transaction)
throws org.apereo.cas.authentication.AuthenticationException
builder - the buildertransaction - the transactionAuthenticationException - the authentication exceptionprotected org.apache.commons.lang3.tuple.Pair<java.lang.Boolean,java.util.Set<java.lang.Throwable>> evaluateAuthenticationPolicies(org.apereo.cas.authentication.Authentication authentication)
authentication - the authenticationprotected void handleAuthenticationException(java.lang.Throwable e,
java.lang.String name,
org.apereo.cas.authentication.AuthenticationBuilder builder)
e - the exceptionname - the namebuilder - the builder