Class InitializeOAuth2ClientAuthenticationContext
- 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.InitializeOAuth2ClientAuthenticationContext
-
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,ProfileAction,Aware,MessageSource,MessageSourceAware,Action
public class InitializeOAuth2ClientAuthenticationContext extends net.shibboleth.idp.profile.AbstractProfileActionAnactionthat resolves the Client Authentication method for the chosen upstream OpenID Provider (issuer) from the profile configuration.- Event:
EventIds.PROCEED_EVENT_ID,IdPEventIds.INVALID_PROFILE_CONFIG,EventIds.INVALID_PROFILE_CTX,IdPEventIds.INVALID_RELYING_PARTY_CONFIG- Postcondition:
- Add the
ClientAuthenticationMethodto theOAuth2ClientAuthenticationContext
-
-
Field Summary
Fields Modifier and Type Field Description private org.slf4j.LoggerlogClass logger.private net.shibboleth.oidc.authn.context.OAuth2ClientAuthenticationContextoauth2ClientAuthenticationContextThe stashed OAuth2 client authentication context.private Function<ProfileRequestContext,net.shibboleth.oidc.authn.context.OAuth2ClientAuthenticationContext>oauth2ClientAuthenticationContextLookupStrategyThe strategy used to lookup or create theOAuth2ClientAuthenticationContextfor storing the client authentication.private net.shibboleth.oidc.profile.config.OIDCAuthenticationRelyingPartyProfileConfigurationprofileConfigurationApplicable stashed profile configuration.private Function<ProfileRequestContext,net.shibboleth.idp.profile.context.RelyingPartyContext>relyingPartyContextLookupStrategyLookup function for relying party context.
-
Constructor Summary
Constructors Constructor Description InitializeOAuth2ClientAuthenticationContext()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.nimbusds.oauth2.sdk.auth.ClientAuthenticationconstructClientAuthentication(String clientId, String tokenEndpointAuthMethod, net.shibboleth.oidc.security.credential.ClientSecretCredential clientCredential)Construct the client authentication from the given client authentication record.private StringconvertSecretKeyToString(SecretKey key)Convert the encoded byte array representing the secret into a UTF-8 String.protected voiddoExecute(ProfileRequestContext profileRequestContext)protected booleandoPreExecute(ProfileRequestContext profileRequestContext)voidsetOAuth2ClientAuthenticationContextLookupStrategy(Function<ProfileRequestContext,net.shibboleth.oidc.authn.context.OAuth2ClientAuthenticationContext> strgy)Set the strategy to lookup theOAuth2ClientAuthenticationContextfrom theProfileRequestContext.voidsetRelyingPartyContextLookupStrategy(Function<ProfileRequestContext,net.shibboleth.idp.profile.context.RelyingPartyContext> strategy)Set lookup strategy for relying party context.-
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.
-
oauth2ClientAuthenticationContextLookupStrategy
@Nonnull private Function<ProfileRequestContext,net.shibboleth.oidc.authn.context.OAuth2ClientAuthenticationContext> oauth2ClientAuthenticationContextLookupStrategy
The strategy used to lookup or create theOAuth2ClientAuthenticationContextfor storing the client authentication.
-
oauth2ClientAuthenticationContext
@Nullable private net.shibboleth.oidc.authn.context.OAuth2ClientAuthenticationContext oauth2ClientAuthenticationContext
The stashed OAuth2 client authentication context.
-
relyingPartyContextLookupStrategy
@Nonnull private Function<ProfileRequestContext,net.shibboleth.idp.profile.context.RelyingPartyContext> relyingPartyContextLookupStrategy
Lookup function for relying party context.
-
profileConfiguration
@Nullable private net.shibboleth.oidc.profile.config.OIDCAuthenticationRelyingPartyProfileConfiguration profileConfiguration
Applicable stashed profile configuration.
-
-
Method Detail
-
setRelyingPartyContextLookupStrategy
public void setRelyingPartyContextLookupStrategy(@Nonnull Function<ProfileRequestContext,net.shibboleth.idp.profile.context.RelyingPartyContext> strategy)Set lookup strategy for relying party context.- Parameters:
strategy- lookup strategy
-
setOAuth2ClientAuthenticationContextLookupStrategy
public void setOAuth2ClientAuthenticationContextLookupStrategy(@Nonnull Function<ProfileRequestContext,net.shibboleth.oidc.authn.context.OAuth2ClientAuthenticationContext> strgy)Set the strategy to lookup theOAuth2ClientAuthenticationContextfrom theProfileRequestContext.- Parameters:
strgy- the strategy.
-
doPreExecute
protected boolean doPreExecute(@Nonnull ProfileRequestContext profileRequestContext)- Overrides:
doPreExecutein classAbstractConditionalProfileAction
-
doExecute
protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext)- Overrides:
doExecutein classAbstractProfileAction
-
constructClientAuthentication
@Nullable protected com.nimbusds.oauth2.sdk.auth.ClientAuthentication constructClientAuthentication(@Nonnull String clientId, @Nonnull String tokenEndpointAuthMethod, @Nonnull net.shibboleth.oidc.security.credential.ClientSecretCredential clientCredential)Construct the client authentication from the given client authentication record.- Parameters:
clientId- the client_idtokenEndpointAuthMethod- the token endpoint authentication methodclientCredential- the client credential- Returns:
- the constructed client authentication
-
-