Package net.shibboleth.idp.cas.flow.impl
Class GrantServiceTicketAction
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- org.opensaml.profile.action.AbstractProfileAction
-
- org.opensaml.profile.action.AbstractConditionalProfileAction
-
- net.shibboleth.idp.profile.AbstractProfileAction
-
- net.shibboleth.idp.cas.flow.impl.AbstractCASProtocolAction<ServiceTicketRequest,ServiceTicketResponse>
-
- net.shibboleth.idp.cas.flow.impl.GrantServiceTicketAction
-
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,ProfileAction,Aware,MessageSource,MessageSourceAware,Action
public class GrantServiceTicketAction extends AbstractCASProtocolAction<ServiceTicketRequest,ServiceTicketResponse>
Generates and stores a CAS protocol service ticket. Possible outcomes:nullon successTicketCreationError
-
-
Field Summary
Fields Modifier and Type Field Description private Function<ProfileRequestContext,AttributeContext>attributeContextLookupStrategyStrategy used to locate theAttributeContextassociated with a givenProfileRequestContext.private AttributeContextattributeCtxAttributeContext to use.private Function<ProfileRequestContext,AuthenticationContext>authnCtxLookupFunctionAuthenticationContext lookup function.private AuthenticationResultauthnResultAuthentication result.private TicketServicecasTicketServiceManages CAS tickets.private ConfigLookupFunction<LoginConfiguration>configLookupFunctionProfile configuration lookup function.private org.slf4j.LoggerlogClass logger.private LoginConfigurationloginConfigProfile config.private Function<ProfileRequestContext,String>principalLookupFunctionFunction to retrieve subject principal name.private ServiceTicketRequestrequestCAS request.private SecurityConfigurationsecurityConfigSecurity config.private IdPSessionsessionIdP's session.private Function<ProfileRequestContext,SessionContext>sessionContextFunctionLooks up an IdP session context from IdP profile request context.private booleanstoreConsentWhether consent needs to be stored in ticket.
-
Constructor Summary
Constructors Constructor Description GrantServiceTicketAction(TicketService ticketService)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoExecute(ProfileRequestContext profileRequestContext)protected booleandoPreExecute(ProfileRequestContext profileRequestContext)private IdPSessiongetIdPSession(ProfileRequestContext prc)Get the IdP session.private AuthenticationResultgetLatestAuthenticationResult()Gets the most recent authentication result from the IdP session.private StringgetPrincipalName(ProfileRequestContext prc)Get the IdP subject principal name.voidsetAttributeContextLookupStrategy(Function<ProfileRequestContext,AttributeContext> strategy)Set the strategy used to locate theAttributeContextassociated with a givenProfileRequestContext.-
Methods inherited from class net.shibboleth.idp.cas.flow.impl.AbstractCASProtocolAction
getCASRequest, getCASResponse, getCASService, getCASTicket, getProtocolContext, setCASRequest, setCASResponse, setCASService, setCASTicket
-
Methods inherited from class net.shibboleth.idp.profile.AbstractProfileAction
doExecute, execute, getBean, getBean, getMessage, getMessage, getMessage, getParameter, getParameter, getProfileContextLookupStrategy, getRequestContext, getResult, setMessageSource, setProfileContextLookupStrategy
-
Methods inherited from class org.opensaml.profile.action.AbstractConditionalProfileAction
getActivationCondition, setActivationCondition
-
Methods inherited from class org.opensaml.profile.action.AbstractProfileAction
doPostExecute, doPostExecute, execute, getHttpServletRequest, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, setHttpServletRequest, setHttpServletRequestSupplier, setHttpServletResponse, setHttpServletResponseSupplier
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, doInitialize, initialize, isDestroyed, isInitialized
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent
initialize, isInitialized
-
-
-
-
Field Detail
-
log
@Nonnull private final org.slf4j.Logger log
Class logger.
-
configLookupFunction
@Nonnull private final ConfigLookupFunction<LoginConfiguration> configLookupFunction
Profile configuration lookup function.
-
sessionContextFunction
@Nonnull private final Function<ProfileRequestContext,SessionContext> sessionContextFunction
Looks up an IdP session context from IdP profile request context.
-
authnCtxLookupFunction
@Nonnull private final Function<ProfileRequestContext,AuthenticationContext> authnCtxLookupFunction
AuthenticationContext lookup function.
-
principalLookupFunction
@Nonnull private final Function<ProfileRequestContext,String> principalLookupFunction
Function to retrieve subject principal name.
-
attributeContextLookupStrategy
@Nonnull private Function<ProfileRequestContext,AttributeContext> attributeContextLookupStrategy
Strategy used to locate theAttributeContextassociated with a givenProfileRequestContext.
-
casTicketService
@Nonnull private final TicketService casTicketService
Manages CAS tickets.
-
loginConfig
@Nullable private LoginConfiguration loginConfig
Profile config.
-
securityConfig
@Nullable private SecurityConfiguration securityConfig
Security config.
-
session
@Nullable private IdPSession session
IdP's session.
-
authnResult
@Nullable private AuthenticationResult authnResult
Authentication result.
-
storeConsent
private boolean storeConsent
Whether consent needs to be stored in ticket.
-
attributeCtx
@Nullable private AttributeContext attributeCtx
AttributeContext to use.
-
request
@Nullable private ServiceTicketRequest request
CAS request.
-
-
Constructor Detail
-
GrantServiceTicketAction
public GrantServiceTicketAction(@Nonnull TicketService ticketService)Constructor.- Parameters:
ticketService- Ticket service component.
-
-
Method Detail
-
setAttributeContextLookupStrategy
public void setAttributeContextLookupStrategy(@Nonnull Function<ProfileRequestContext,AttributeContext> strategy)Set the strategy used to locate theAttributeContextassociated with a givenProfileRequestContext.- Parameters:
strategy- strategy used to locate theAttributeContextassociated with a givenProfileRequestContext- Since:
- 4.2.0
-
doPreExecute
protected boolean doPreExecute(@Nonnull ProfileRequestContext profileRequestContext)- Overrides:
doPreExecutein classAbstractConditionalProfileAction
-
doExecute
protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext)- Overrides:
doExecutein classAbstractProfileAction
-
getIdPSession
@Nullable private IdPSession getIdPSession(ProfileRequestContext prc)
Get the IdP session.- Parameters:
prc- profile request context- Returns:
- IdP session
-
getPrincipalName
@Nonnull private String getPrincipalName(ProfileRequestContext prc)
Get the IdP subject principal name.- Parameters:
prc- profile request context.- Returns:
- Principal name.
-
getLatestAuthenticationResult
@Nullable private AuthenticationResult getLatestAuthenticationResult()
Gets the most recent authentication result from the IdP session.- Returns:
- Latest authentication result.
- Throws:
IllegalStateException- If no authentication results are found.
-
-