public class DelegatedClientAuthenticationAction
extends org.apereo.cas.web.flow.actions.AbstractAuthenticationAction
Before any authentication, redirection urls are computed for the different clients defined as well as the theme, locale, method and service are saved into the web session.
After authentication, appropriate information are expected on this callback url to finish the authentication process with the provider.| Modifier and Type | Class and Description |
|---|---|
static class |
DelegatedClientAuthenticationAction.ProviderLoginPageConfiguration
The Provider login page configuration.
|
| Modifier and Type | Field and Description |
|---|---|
protected org.apereo.cas.authentication.AuthenticationSystemSupport |
authenticationSystemSupport
The Authentication system support.
|
protected org.pac4j.core.client.Clients |
clients
The Clients.
|
protected org.apereo.cas.audit.AuditableExecution |
delegatedAuthenticationPolicyEnforcer
The Delegated authentication policy enforcer.
|
protected DelegatedClientWebflowManager |
delegatedClientWebflowManager
The Delegated client webflow manager.
|
protected org.apereo.cas.web.pac4j.DelegatedSessionCookieManager |
delegatedSessionCookieManager
The Delegated session cookie manager.
|
protected java.lang.String |
localeParamName
The Locale param name.
|
static java.lang.String |
PAC4J_URLS
All the urls and names of the pac4j clients.
|
protected org.apereo.cas.services.ServicesManager |
servicesManager
The Services manager.
|
protected java.lang.String |
themeParamName
The Theme param name.
|
| Constructor and Description |
|---|
DelegatedClientAuthenticationAction(org.apereo.cas.web.flow.resolver.CasDelegatingWebflowEventResolver initialAuthenticationAttemptWebflowEventResolver,
org.apereo.cas.web.flow.resolver.CasWebflowEventResolver serviceTicketRequestWebflowEventResolver,
org.apereo.cas.authentication.adaptive.AdaptiveAuthenticationPolicy adaptiveAuthenticationPolicy,
org.pac4j.core.client.Clients clients,
org.apereo.cas.services.ServicesManager servicesManager,
org.apereo.cas.audit.AuditableExecution delegatedAuthenticationPolicyEnforcer,
DelegatedClientWebflowManager delegatedClientWebflowManager,
org.apereo.cas.web.pac4j.DelegatedSessionCookieManager delegatedSessionCookieManager,
org.apereo.cas.authentication.AuthenticationSystemSupport authenticationSystemSupport,
java.lang.String localeParamName,
java.lang.String themeParamName,
org.apereo.cas.authentication.AuthenticationServiceSelectionPlan authenticationRequestServiceSelectionStrategies,
org.apereo.cas.CentralAuthenticationService centralAuthenticationService) |
| Modifier and Type | Method and Description |
|---|---|
protected java.util.Optional<DelegatedClientAuthenticationAction.ProviderLoginPageConfiguration> |
buildProviderConfiguration(org.pac4j.core.client.IndirectClient client,
org.pac4j.core.context.WebContext webContext,
org.apereo.cas.authentication.principal.WebApplicationService service)
Build provider configuration optional.
|
org.springframework.webflow.execution.Event |
doExecute(org.springframework.webflow.execution.RequestContext context) |
protected org.pac4j.core.client.BaseClient<org.pac4j.core.credentials.Credentials,org.pac4j.core.profile.CommonProfile> |
findDelegatedClientByName(javax.servlet.http.HttpServletRequest request,
java.lang.String clientName,
org.apereo.cas.authentication.principal.Service service)
Find delegated client by name base client.
|
protected java.lang.String |
getCssClass(java.lang.String name)
Get a valid CSS class for the given provider name.
|
protected org.springframework.webflow.execution.Event |
handleException(org.pac4j.core.context.J2EContext webContext,
org.pac4j.core.client.BaseClient<org.pac4j.core.credentials.Credentials,org.pac4j.core.profile.CommonProfile> client,
java.lang.Exception e)
Handle the thrown exception.
|
static java.util.Optional<org.springframework.web.servlet.ModelAndView> |
hasDelegationRequestFailed(javax.servlet.http.HttpServletRequest request,
int status)
Determine if request has errors.
|
boolean |
isDelegatedClientAuthorizedFor(java.lang.String clientName,
org.apereo.cas.authentication.principal.Service service)
Is delegated client authorized for boolean.
|
protected boolean |
isDelegatedClientAuthorizedForService(org.pac4j.core.client.Client client,
org.apereo.cas.authentication.principal.Service service)
Is delegated client authorized for service boolean.
|
protected void |
prepareForLoginPage(org.springframework.webflow.execution.RequestContext context)
Prepare the data for the login page.
|
protected org.apereo.cas.authentication.principal.Service |
restoreAuthenticationRequestInContext(org.springframework.webflow.execution.RequestContext requestContext,
org.pac4j.core.context.J2EContext webContext,
java.lang.String clientName)
Restore authentication request in context service.
|
protected org.springframework.webflow.execution.Event |
resumeWebflow()
Resume webflow event.
|
protected org.springframework.webflow.execution.Event |
stopWebflow()
Stop webflow event.
|
onError, onSuccess, onWarnpublic static final java.lang.String PAC4J_URLS
protected final org.pac4j.core.client.Clients clients
protected final org.apereo.cas.services.ServicesManager servicesManager
protected final org.apereo.cas.audit.AuditableExecution delegatedAuthenticationPolicyEnforcer
protected final DelegatedClientWebflowManager delegatedClientWebflowManager
protected final org.apereo.cas.web.pac4j.DelegatedSessionCookieManager delegatedSessionCookieManager
protected final org.apereo.cas.authentication.AuthenticationSystemSupport authenticationSystemSupport
protected final java.lang.String localeParamName
protected final java.lang.String themeParamName
public DelegatedClientAuthenticationAction(org.apereo.cas.web.flow.resolver.CasDelegatingWebflowEventResolver initialAuthenticationAttemptWebflowEventResolver,
org.apereo.cas.web.flow.resolver.CasWebflowEventResolver serviceTicketRequestWebflowEventResolver,
org.apereo.cas.authentication.adaptive.AdaptiveAuthenticationPolicy adaptiveAuthenticationPolicy,
org.pac4j.core.client.Clients clients,
org.apereo.cas.services.ServicesManager servicesManager,
org.apereo.cas.audit.AuditableExecution delegatedAuthenticationPolicyEnforcer,
DelegatedClientWebflowManager delegatedClientWebflowManager,
org.apereo.cas.web.pac4j.DelegatedSessionCookieManager delegatedSessionCookieManager,
org.apereo.cas.authentication.AuthenticationSystemSupport authenticationSystemSupport,
java.lang.String localeParamName,
java.lang.String themeParamName,
org.apereo.cas.authentication.AuthenticationServiceSelectionPlan authenticationRequestServiceSelectionStrategies,
org.apereo.cas.CentralAuthenticationService centralAuthenticationService)
public static java.util.Optional<org.springframework.web.servlet.ModelAndView> hasDelegationRequestFailed(javax.servlet.http.HttpServletRequest request,
int status)
request - the requeststatus - the statuspublic org.springframework.webflow.execution.Event doExecute(org.springframework.webflow.execution.RequestContext context)
doExecute in class org.apereo.cas.web.flow.actions.AbstractAuthenticationActionprotected org.springframework.webflow.execution.Event handleException(org.pac4j.core.context.J2EContext webContext,
org.pac4j.core.client.BaseClient<org.pac4j.core.credentials.Credentials,org.pac4j.core.profile.CommonProfile> client,
java.lang.Exception e)
webContext - the web contextclient - the authentication cliente - the thrown exceptionpublic boolean isDelegatedClientAuthorizedFor(java.lang.String clientName,
org.apereo.cas.authentication.principal.Service service)
clientName - the client nameservice - the serviceprotected org.pac4j.core.client.BaseClient<org.pac4j.core.credentials.Credentials,org.pac4j.core.profile.CommonProfile> findDelegatedClientByName(javax.servlet.http.HttpServletRequest request,
java.lang.String clientName,
org.apereo.cas.authentication.principal.Service service)
request - the requestclientName - the client nameservice - the serviceprotected void prepareForLoginPage(org.springframework.webflow.execution.RequestContext context)
context - The current webflow contextprotected java.util.Optional<DelegatedClientAuthenticationAction.ProviderLoginPageConfiguration> buildProviderConfiguration(org.pac4j.core.client.IndirectClient client, org.pac4j.core.context.WebContext webContext, org.apereo.cas.authentication.principal.WebApplicationService service)
client - the clientwebContext - the web contextservice - the serviceprotected java.lang.String getCssClass(java.lang.String name)
name - Name of the providerprotected org.springframework.webflow.execution.Event stopWebflow()
protected org.springframework.webflow.execution.Event resumeWebflow()
protected boolean isDelegatedClientAuthorizedForService(org.pac4j.core.client.Client client,
org.apereo.cas.authentication.principal.Service service)
client - the clientservice - the serviceprotected org.apereo.cas.authentication.principal.Service restoreAuthenticationRequestInContext(org.springframework.webflow.execution.RequestContext requestContext,
org.pac4j.core.context.J2EContext webContext,
java.lang.String clientName)
requestContext - the request contextwebContext - the web contextclientName - the client name