Class CasAuthenticator
java.lang.Object
org.pac4j.core.util.InitializableObject
org.pac4j.core.profile.definition.ProfileDefinitionAware
org.pac4j.cas.credentials.authenticator.CasAuthenticator
- All Implemented Interfaces:
org.pac4j.core.credentials.authenticator.Authenticator
public class CasAuthenticator
extends org.pac4j.core.profile.definition.ProfileDefinitionAware
implements org.pac4j.core.credentials.authenticator.Authenticator
CAS authenticator which validates the service ticket.
- Since:
- 1.9.2
- Author:
- Jerome Leleu
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected org.pac4j.core.http.callback.CallbackUrlResolverprotected Stringprotected CasConfigurationprotected org.pac4j.core.logout.handler.SessionLogoutHandlerprotected org.pac4j.core.http.url.UrlResolverFields inherited from interface org.pac4j.core.credentials.authenticator.Authenticator
ALWAYS_VALIDATE, NEVER_VALIDATE -
Constructor Summary
ConstructorsConstructorDescriptionCasAuthenticator(CasConfiguration configuration, String clientName, org.pac4j.core.http.url.UrlResolver urlResolver, org.pac4j.core.http.callback.CallbackUrlResolver callbackUrlResolver, String callbackUrl, org.pac4j.core.logout.handler.SessionLogoutHandler sessionLogoutHandler) Constructor for CasAuthenticator. -
Method Summary
Modifier and TypeMethodDescriptionprotected org.pac4j.core.profile.UserProfilecreateUserProfile(org.apereo.cas.client.authentication.AttributePrincipal principal) protected voidcreateUserProfileAttributes(org.apereo.cas.client.validation.Assertion assertion, org.apereo.cas.client.authentication.AttributePrincipal principal, org.pac4j.core.profile.UserProfile profile) protected voidinternalInit(boolean forceReinit) protected voidrecordSession(org.pac4j.core.context.CallContext ctx, String ticket) Optional<org.pac4j.core.credentials.Credentials>validate(org.pac4j.core.context.CallContext ctx, org.pac4j.core.credentials.Credentials cred) protected org.apereo.cas.client.validation.AssertionvalidateTicket(org.pac4j.core.context.WebContext webContext, String ticket) Methods inherited from class org.pac4j.core.profile.definition.ProfileDefinitionAware
getProfileDefinition, setProfileDefinition, setProfileDefinitionIfUndefinedMethods inherited from class org.pac4j.core.util.InitializableObject
afterInternalInit, beforeInternalInit, getInitialized, getLastAttempt, getMaxAttempts, getMinTimeIntervalBetweenAttemptsInMilliseconds, getNbAttempts, init, init, isInitialized, reinit, setMaxAttempts, setMinTimeIntervalBetweenAttemptsInMilliseconds, shouldInitialize, toString
-
Field Details
-
configuration
-
clientName
-
urlResolver
protected org.pac4j.core.http.url.UrlResolver urlResolver -
callbackUrlResolver
protected org.pac4j.core.http.callback.CallbackUrlResolver callbackUrlResolver -
callbackUrl
-
sessionLogoutHandler
protected org.pac4j.core.logout.handler.SessionLogoutHandler sessionLogoutHandler
-
-
Constructor Details
-
CasAuthenticator
public CasAuthenticator(CasConfiguration configuration, String clientName, org.pac4j.core.http.url.UrlResolver urlResolver, org.pac4j.core.http.callback.CallbackUrlResolver callbackUrlResolver, String callbackUrl, org.pac4j.core.logout.handler.SessionLogoutHandler sessionLogoutHandler) Constructor for CasAuthenticator.
- Parameters:
configuration- aCasConfigurationobjectclientName- aStringobjecturlResolver- aUrlResolverobjectcallbackUrlResolver- aCallbackUrlResolverobjectcallbackUrl- aStringobjectsessionLogoutHandler- the sessionLogoutHandler
-
-
Method Details
-
internalInit
protected void internalInit(boolean forceReinit) - Specified by:
internalInitin classorg.pac4j.core.util.InitializableObject
-
validate
public Optional<org.pac4j.core.credentials.Credentials> validate(org.pac4j.core.context.CallContext ctx, org.pac4j.core.credentials.Credentials cred) - Specified by:
validatein interfaceorg.pac4j.core.credentials.authenticator.Authenticator
-
recordSession
-
createUserProfileAttributes
protected void createUserProfileAttributes(org.apereo.cas.client.validation.Assertion assertion, org.apereo.cas.client.authentication.AttributePrincipal principal, org.pac4j.core.profile.UserProfile profile) -
createUserProfile
protected org.pac4j.core.profile.UserProfile createUserProfile(org.apereo.cas.client.authentication.AttributePrincipal principal) -
validateTicket
protected org.apereo.cas.client.validation.Assertion validateTicket(org.pac4j.core.context.WebContext webContext, String ticket) throws org.apereo.cas.client.validation.TicketValidationException - Throws:
org.apereo.cas.client.validation.TicketValidationException
-