Class ExtractIDTokenFromResponse
- 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.plugin.authn.oidc.rp.impl.ExtractIDTokenFromResponse
-
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,ProfileAction,Aware,MessageSource,MessageSourceAware,Action
public class ExtractIDTokenFromResponse extends net.shibboleth.idp.profile.AbstractProfileActionAction that extracts an id_token from the access token response and sets it onto theAccessTokenResponseContext. The id_token must either be signed, or signed and encrypted, plain id_tokens are not supported — this helps prevent 'alg=none' header manipulation.- Event:
EventIds.PROCEED_EVENT_ID,EventIds.INVALID_PROFILE_CTX,OidcEventIds.INVALID_ID_TOKEN- Postcondition:
- id_token added to
AccessTokenResponseContext.
-
-
Field Summary
Fields Modifier and Type Field Description private org.slf4j.LoggerlogClass logger.private Function<ProfileRequestContext,String>rawIdTokenLookupStrategyFunction that looks up a raw id_token value as a base64 encoded string.private AccessTokenResponseContextresponseCtxThe token response context to add the decoded id_token too.private Function<ProfileRequestContext,AccessTokenResponseContext>tokenResponseContextLookupStrategyStrategy used to look up theAccessTokenResponseContextto set the parameters for.
-
Constructor Summary
Constructors Constructor Description ExtractIDTokenFromResponse()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoExecute(ProfileRequestContext profileRequestContext)protected voiddoInitialize()protected booleandoPreExecute(ProfileRequestContext profileRequestContext)voidsetRawIdTokenLookupStrategy(Function<ProfileRequestContext,String> strategy)Set the strategy used to lookup a base64 encoded JWT from the profile request context.voidsetTokenResponseContextLookupStrategy(Function<ProfileRequestContext,AccessTokenResponseContext> strategy)Set the strategy used to look up aAccessTokenResponseContext.-
Methods inherited from class net.shibboleth.idp.profile.AbstractProfileAction
doExecute, execute, getMessage, getMessage, getMessage, 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, getHttpServletResponse, getLogPrefix, setHttpServletRequest, setHttpServletResponse
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, 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.
-
rawIdTokenLookupStrategy
@NonnullAfterInit private Function<ProfileRequestContext,String> rawIdTokenLookupStrategy
Function that looks up a raw id_token value as a base64 encoded string.
-
responseCtx
@NonnullAfterInit private AccessTokenResponseContext responseCtx
The token response context to add the decoded id_token too.
-
tokenResponseContextLookupStrategy
@Nonnull private Function<ProfileRequestContext,AccessTokenResponseContext> tokenResponseContextLookupStrategy
Strategy used to look up theAccessTokenResponseContextto set the parameters for.
-
-
Method Detail
-
setTokenResponseContextLookupStrategy
public void setTokenResponseContextLookupStrategy(@Nonnull Function<ProfileRequestContext,AccessTokenResponseContext> strategy)Set the strategy used to look up aAccessTokenResponseContext.- Parameters:
strategy- lookup strategy
-
doInitialize
protected void doInitialize() throws ComponentInitializationException- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
doPreExecute
protected boolean doPreExecute(@Nonnull ProfileRequestContext profileRequestContext)- Overrides:
doPreExecutein classAbstractConditionalProfileAction
-
setRawIdTokenLookupStrategy
public void setRawIdTokenLookupStrategy(@Nonnull Function<ProfileRequestContext,String> strategy)Set the strategy used to lookup a base64 encoded JWT from the profile request context.- Parameters:
strategy- the strategy to use.
-
doExecute
protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext)- Overrides:
doExecutein classAbstractProfileAction
-
-