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

    Fields
    Modifier and Type
    Field
    Description
    protected String
     
    protected org.pac4j.core.http.callback.CallbackUrlResolver
     
    protected String
     
     
    protected org.pac4j.core.logout.handler.SessionLogoutHandler
     
    protected org.pac4j.core.http.url.UrlResolver
     

    Fields inherited from interface org.pac4j.core.credentials.authenticator.Authenticator

    ALWAYS_VALIDATE, NEVER_VALIDATE
  • Constructor Summary

    Constructors
    Constructor
    Description
    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.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.pac4j.core.profile.UserProfile
    createUserProfile(org.apereo.cas.client.authentication.AttributePrincipal principal)
     
    protected void
    createUserProfileAttributes(org.apereo.cas.client.validation.Assertion assertion, org.apereo.cas.client.authentication.AttributePrincipal principal, org.pac4j.core.profile.UserProfile profile)
     
    protected void
    internalInit(boolean forceReinit)
    protected void
    recordSession(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.Assertion
    validateTicket(org.pac4j.core.context.WebContext webContext, String ticket)
     

    Methods inherited from class org.pac4j.core.profile.definition.ProfileDefinitionAware

    getProfileDefinition, setProfileDefinition, setProfileDefinitionIfUndefined

    Methods inherited from class org.pac4j.core.util.InitializableObject

    afterInternalInit, beforeInternalInit, getInitialized, getLastAttempt, getMaxAttempts, getMinTimeIntervalBetweenAttemptsInMilliseconds, getNbAttempts, init, init, isInitialized, reinit, setMaxAttempts, setMinTimeIntervalBetweenAttemptsInMilliseconds, shouldInitialize, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • configuration

      protected CasConfiguration configuration
    • clientName

      protected String clientName
    • urlResolver

      protected org.pac4j.core.http.url.UrlResolver urlResolver
    • callbackUrlResolver

      protected org.pac4j.core.http.callback.CallbackUrlResolver callbackUrlResolver
    • callbackUrl

      protected String 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 - a CasConfiguration object
      clientName - a String object
      urlResolver - a UrlResolver object
      callbackUrlResolver - a CallbackUrlResolver object
      callbackUrl - a String object
      sessionLogoutHandler - the sessionLogoutHandler
  • Method Details

    • internalInit

      protected void internalInit(boolean forceReinit)
      Specified by:
      internalInit in class org.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:
      validate in interface org.pac4j.core.credentials.authenticator.Authenticator
    • recordSession

      protected void recordSession(org.pac4j.core.context.CallContext ctx, String ticket)
    • 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