public abstract class AbstractMultiFactorAuthenticationViaFormAction
extends org.springframework.webflow.action.AbstractAction
AuthenticationViaFormAction.
Implementations are notified of the authentication type (MFA, non-MFA) and are responsible to act accordingly.
| Modifier and Type | Field and Description |
|---|---|
protected org.jasig.cas.authentication.AuthenticationManager |
authenticationManager
The authentication manager.
|
protected AuthenticationMethodVerifier |
authenticationMethodVerifier
The authenticationMethodVerifier.
|
protected net.unicon.cas.addons.authentication.AuthenticationSupport |
authenticationSupport
The authentication support.
|
protected org.jasig.cas.CentralAuthenticationService |
cas
The central authentication service.
|
protected org.jasig.cas.web.bind.CredentialsBinder |
credentialsBinder
The credentials binder.
|
protected org.slf4j.Logger |
logger
The logger.
|
protected MultiFactorAuthenticationRequestResolver |
multiFactorAuthenticationRequestResolver
MultiFactorAuthenticationRequestResolver.
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractMultiFactorAuthenticationViaFormAction(MultiFactorAuthenticationRequestResolver multiFactorAuthenticationRequestResolver,
net.unicon.cas.addons.authentication.AuthenticationSupport authenticationSupport,
AuthenticationMethodVerifier authenticationMethodVerifier,
RequestedAuthenticationMethodRankingStrategy authenticationMethodRankingStrategy,
String hostname)
Ctor.
|
| Modifier and Type | Method and Description |
|---|---|
protected MultiFactorAuthenticationSupportingWebApplicationService |
addToMfaTransactionAndGetHighestRankedMfaRequest(List<MultiFactorAuthenticationRequestContext> mfaRequests,
org.springframework.webflow.execution.RequestContext context)
Add the request to mfa transaction, re-rank and return the newly ranked one.
|
void |
afterPropertiesSet() |
protected abstract org.springframework.webflow.execution.Event |
doAuthentication(org.springframework.webflow.execution.RequestContext context,
org.jasig.cas.authentication.principal.Credentials credentials,
org.springframework.binding.message.MessageContext messageContext,
String id)
In the event of a non-MFA request, return the result of
getErrorEvent(RequestContext) by default. |
void |
doBind(org.springframework.webflow.execution.RequestContext context,
org.jasig.cas.authentication.principal.Credentials credentials)
Bind the request to the credentials.
|
protected org.springframework.webflow.execution.Event |
doExecute(org.springframework.webflow.execution.RequestContext ctx) |
protected org.springframework.webflow.execution.Event |
doMultiFactorAuthentication(org.springframework.webflow.execution.RequestContext context,
org.jasig.cas.authentication.principal.Credentials credentials,
org.springframework.binding.message.MessageContext messageContext,
String id)
In the event of an MFA request, authenticate the credentials by default, and place
the authentication context back into the flow.
|
protected org.springframework.webflow.execution.Event |
getErrorEvent(org.springframework.webflow.execution.RequestContext context)
The webflow error event id.
|
protected List<MultiFactorAuthenticationRequestContext> |
getMfaRequestOrNull(org.jasig.cas.authentication.Authentication authentication,
org.jasig.cas.authentication.principal.WebApplicationService service,
org.springframework.webflow.execution.RequestContext context)
Get MFA request or null.
|
protected org.springframework.webflow.execution.Event |
getSuccessEvent(org.springframework.webflow.execution.RequestContext context)
Return the mfa webflow id.
|
protected boolean |
isValidLoginTicket(org.springframework.webflow.execution.RequestContext context,
org.springframework.binding.message.MessageContext messageContext)
Checks if is valid login ticket.
|
protected abstract org.springframework.webflow.execution.Event |
multiFactorAuthenticationSuccessful(org.jasig.cas.authentication.Authentication authentication,
org.springframework.webflow.execution.RequestContext context,
org.jasig.cas.authentication.principal.Credentials credentials,
org.springframework.binding.message.MessageContext messageContext,
String id)
Multifactor authentication successful.
|
protected void |
populateErrorsInstance(String code,
org.springframework.binding.message.MessageContext messageContext)
Populate errors instance.
|
void |
setCentralAuthenticationService(org.jasig.cas.CentralAuthenticationService centralAuthenticationService)
CAS instance used to handle authentications.
|
void |
setCredentialsBinder(org.jasig.cas.web.bind.CredentialsBinder credentialsBinder)
Set the binder instance.
|
void |
setErrorEventBuilder(MultiFactorAuthenticationSpringWebflowEventBuilder errorEventBuilder) |
void |
setMultiFactorAuthenticationManager(org.jasig.cas.authentication.AuthenticationManager manager)
Authentication manager instance to authenticate the user by its configured
handlers as the first leg of an multifactor authentication sequence.
|
void |
setSuccessfulEventBuilder(MultiFactorAuthenticationSpringWebflowEventBuilder successfulEventBuilder) |
protected final org.slf4j.Logger logger
@NotNull protected org.jasig.cas.authentication.AuthenticationManager authenticationManager
@NotNull protected org.jasig.cas.CentralAuthenticationService cas
@NotNull protected org.jasig.cas.web.bind.CredentialsBinder credentialsBinder
protected final MultiFactorAuthenticationRequestResolver multiFactorAuthenticationRequestResolver
protected final net.unicon.cas.addons.authentication.AuthenticationSupport authenticationSupport
protected final AuthenticationMethodVerifier authenticationMethodVerifier
protected AbstractMultiFactorAuthenticationViaFormAction(MultiFactorAuthenticationRequestResolver multiFactorAuthenticationRequestResolver, net.unicon.cas.addons.authentication.AuthenticationSupport authenticationSupport, AuthenticationMethodVerifier authenticationMethodVerifier, RequestedAuthenticationMethodRankingStrategy authenticationMethodRankingStrategy, String hostname)
multiFactorAuthenticationRequestResolver - multiFactorAuthenticationRequestResolverauthenticationSupport - authenticationSupportauthenticationMethodVerifier - authenticationMethodVerifierauthenticationMethodRankingStrategy - authenticationMethodRankingStrategyhostname - the CAS server hostnamepublic final void doBind(org.springframework.webflow.execution.RequestContext context,
org.jasig.cas.authentication.principal.Credentials credentials)
throws Exception
context - the contextcredentials - credentialsException - if the binding operation fails, or if the request cant be obtainedprotected final org.springframework.webflow.execution.Event doMultiFactorAuthentication(org.springframework.webflow.execution.RequestContext context,
org.jasig.cas.authentication.principal.Credentials credentials,
org.springframework.binding.message.MessageContext messageContext,
String id)
throws Exception
Coming from the 'doAuthentication' and checking if the principal mfa source has been ranked or not Or if coming straight from initial transition. In either case, if there is no mfa service already in the flow scope try to get the principal attribute sourced mfa request and re-rank the existing mfa tx, so the mfa service is always available in the flow scope for downstream subflows.
If we get to this method, the mfa transaction is guaranteed to be in the flow scope.
context - request contextcredentials - the requesting credentialsmessageContext - the message bundle managerid - the identifier of the credential, based on implementation provided in the flow setup.Exception - the exceptionprotected abstract org.springframework.webflow.execution.Event doAuthentication(org.springframework.webflow.execution.RequestContext context,
org.jasig.cas.authentication.principal.Credentials credentials,
org.springframework.binding.message.MessageContext messageContext,
String id)
throws Exception
getErrorEvent(RequestContext) by default.
Implementations are expected to override this method if they wish to respond to authentication
requests.context - request contextcredentials - the requesting credentialsmessageContext - the message bundle managerid - the identifier of the credential, based on implementation provided in the flow setupException - the exceptionprotected final boolean isValidLoginTicket(org.springframework.webflow.execution.RequestContext context,
org.springframework.binding.message.MessageContext messageContext)
context - the contextmessageContext - the message contextprotected abstract org.springframework.webflow.execution.Event multiFactorAuthenticationSuccessful(org.jasig.cas.authentication.Authentication authentication,
org.springframework.webflow.execution.RequestContext context,
org.jasig.cas.authentication.principal.Credentials credentials,
org.springframework.binding.message.MessageContext messageContext,
String id)
throws org.jasig.cas.ticket.TicketException
authentication - the authenticationcontext - the contextcredentials - the credentialsmessageContext - the message contextid - the idorg.jasig.cas.ticket.TicketException - in the event that granting the TGT fails.public final void setCredentialsBinder(org.jasig.cas.web.bind.CredentialsBinder credentialsBinder)
credentialsBinder - the binder instancepublic final void setCentralAuthenticationService(org.jasig.cas.CentralAuthenticationService centralAuthenticationService)
centralAuthenticationService - the cas instance.public void setSuccessfulEventBuilder(MultiFactorAuthenticationSpringWebflowEventBuilder successfulEventBuilder)
public void setErrorEventBuilder(MultiFactorAuthenticationSpringWebflowEventBuilder errorEventBuilder)
public final void setMultiFactorAuthenticationManager(org.jasig.cas.authentication.AuthenticationManager manager)
manager - the new multifactor authentication managerprotected final org.springframework.webflow.execution.Event getErrorEvent(org.springframework.webflow.execution.RequestContext context)
context - the contextprotected final org.springframework.webflow.execution.Event getSuccessEvent(org.springframework.webflow.execution.RequestContext context)
context - the request contextpublic void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanafterPropertiesSet in class org.springframework.webflow.action.AbstractActionExceptionprotected final void populateErrorsInstance(String code, org.springframework.binding.message.MessageContext messageContext)
code - the error codemessageContext - the message contextprotected final org.springframework.webflow.execution.Event doExecute(org.springframework.webflow.execution.RequestContext ctx)
throws Exception
doExecute in class org.springframework.webflow.action.AbstractActionExceptionprotected List<MultiFactorAuthenticationRequestContext> getMfaRequestOrNull(org.jasig.cas.authentication.Authentication authentication, org.jasig.cas.authentication.principal.WebApplicationService service, org.springframework.webflow.execution.RequestContext context)
The service may be null and not available in the context, in cases where one is simply logging into CAS without noting the service application. In those cases, we need to mock up a service instance in order for authentication request resolver (i.e. based on principal attributes) to be able to establish the mfa context and walk the user through the mfa sequence if need be. This dummy service is based on the hostname provided to CAS via configuration, and is CAS itself.
authentication - the authenticationservice - the servicecontext - the contextprotected MultiFactorAuthenticationSupportingWebApplicationService addToMfaTransactionAndGetHighestRankedMfaRequest(List<MultiFactorAuthenticationRequestContext> mfaRequests, org.springframework.webflow.execution.RequestContext context)
mfaRequests - the mfaRequestcontext - the contextCopyright © 2013-2015 Unicon Inc.. All Rights Reserved.