Class PrepareAgentResponse
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.profile.action.AbstractProfileAction
org.opensaml.profile.action.AbstractConditionalProfileAction
net.shibboleth.idp.profile.AbstractProfileAction
net.shibboleth.sp.profile.AbstractAgentRequestAction
net.shibboleth.sp.profile.AbstractAgentAction
net.shibboleth.sp.profile.AbstractApplicationAction
net.shibboleth.sp.profile.AbstractTokenConsumerResponseAction
net.shibboleth.sp.oidc.profile.impl.PrepareAgentResponse
- All Implemented Interfaces:
net.shibboleth.shared.component.Component,net.shibboleth.shared.component.DestructableComponent,net.shibboleth.shared.component.InitializableComponent,org.opensaml.profile.action.ProfileAction,Aware,MessageSource,MessageSourceAware,Action
public class PrepareAgentResponse
extends net.shibboleth.sp.profile.AbstractTokenConsumerResponseAction
OIDC-specific subclass of a token consumer response action.
Extracts the access token and refresh token from the AccessTokenResponseContext
and stores them in the session data return to the agent. These tokens can later be retrieved by the
agent when needed—for example, to refresh user profile information via the
UserInfo endpoint. The access token is used if it is still valid; otherwise,
the refresh token is used to obtain a new access token.
If a DataSealer is supplied, the tokens will be sealed before they are added to the session. Tokens are
sensitive so a data sealer is strongly recommended.
If the data sealer fails to seal a token, that token (and its associated data) will simply not be included in the session data.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Function<org.opensaml.profile.context.ProfileRequestContext,net.shibboleth.oidc.profile.context.AccessTokenResponseContext> Strategy used to look up theAccessTokenResponseContext.private net.shibboleth.shared.security.DataSealerOptional data sealer to use.private final org.slf4j.LoggerClass logger.private net.shibboleth.oidc.profile.context.AccessTokenResponseContextThe stashed token response context. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleandoPreExecute(org.opensaml.profile.context.ProfileRequestContext profileRequestContext) protected net.shibboleth.sp.ddf.DDFgetSessionData(org.opensaml.profile.context.ProfileRequestContext profileRequestContext) voidsetAccessTokenResponseContextLookupStrategy(Function<org.opensaml.profile.context.ProfileRequestContext, net.shibboleth.oidc.profile.context.AccessTokenResponseContext> strategy) Set the strategy used to look up aAccessTokenResponseContext.voidsetDataSealer(net.shibboleth.shared.security.DataSealer sealer) SetsDataSealerto use.Methods inherited from class net.shibboleth.sp.profile.AbstractTokenConsumerResponseAction
doExecute, getSessionNotOnOrAfter, setAttributeContextLookupStrategy, setStateDataContextLookupStrategyMethods inherited from class net.shibboleth.sp.profile.AbstractApplicationAction
ensureApplication, getApplicationMethods inherited from class net.shibboleth.sp.profile.AbstractAgentAction
ensureAgent, getAgentMethods inherited from class net.shibboleth.sp.profile.AbstractAgentRequestAction
ensureAgentRequestContext, getAgentRequestContext, setAgentRequestContextLookupStrategyMethods inherited from class net.shibboleth.idp.profile.AbstractProfileAction
doExecute, execute, getBean, getBean, getMessage, getMessage, getMessage, getParameter, getParameter, getProfileContextLookupStrategy, getRequestContext, getResult, setMessageSource, setProfileContextLookupStrategyMethods inherited from class org.opensaml.profile.action.AbstractConditionalProfileAction
getActivationCondition, setActivationConditionMethods inherited from class org.opensaml.profile.action.AbstractProfileAction
doPostExecute, doPostExecute, ensureHttpServletRequest, ensureHttpServletResponse, execute, getHttpServletRequest, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, isPreExecuteCalled, setHttpServletRequestSupplier, setHttpServletResponseSupplierMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, doInitialize, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitialized
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
accessTokenResponseContextLookupStrategy
@Nonnull private Function<org.opensaml.profile.context.ProfileRequestContext,net.shibboleth.oidc.profile.context.AccessTokenResponseContext> accessTokenResponseContextLookupStrategyStrategy used to look up theAccessTokenResponseContext. -
tokenResponseContext
@NonnullBeforeExec private net.shibboleth.oidc.profile.context.AccessTokenResponseContext tokenResponseContextThe stashed token response context. -
dataSealer
@Nullable private net.shibboleth.shared.security.DataSealer dataSealerOptional data sealer to use.
-
-
Constructor Details
-
PrepareAgentResponse
public PrepareAgentResponse()Constructor.
-
-
Method Details
-
setAccessTokenResponseContextLookupStrategy
public void setAccessTokenResponseContextLookupStrategy(@Nonnull Function<org.opensaml.profile.context.ProfileRequestContext, net.shibboleth.oidc.profile.context.AccessTokenResponseContext> strategy) Set the strategy used to look up aAccessTokenResponseContext.- Parameters:
strategy- lookup strategy
-
doPreExecute
protected boolean doPreExecute(@Nonnull org.opensaml.profile.context.ProfileRequestContext profileRequestContext) - Overrides:
doPreExecutein classnet.shibboleth.sp.profile.AbstractTokenConsumerResponseAction
-
getSessionData
protected net.shibboleth.sp.ddf.DDF getSessionData(org.opensaml.profile.context.ProfileRequestContext profileRequestContext) - Specified by:
getSessionDatain classnet.shibboleth.sp.profile.AbstractTokenConsumerResponseAction