Class DefaultOAuth2TokenAudienceConfiguration
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.profile.config.AbstractProfileConfiguration
net.shibboleth.profile.config.AbstractConditionalProfileConfiguration
net.shibboleth.idp.profile.config.AbstractInterceptorAwareProfileConfiguration
net.shibboleth.oidc.profile.oauth2.config.impl.AbstractOAuth2InterceptorAwareProfileConfiguration
net.shibboleth.oidc.profile.oauth2.config.impl.DefaultOAuth2TokenAudienceConfiguration
- All Implemented Interfaces:
InterceptorAwareProfileConfiguration,OIDCProfileConfiguration,OAuth2AccessTokenProducingProfileConfiguration,OAuth2InterceptorAwareProfileConfiguration,OAuth2ProfileConfiguration,OAuth2ResourceIndicatingProfileConfiguration,OAuth2TokenAudienceConfiguration,OAuth2TokenEncryptionProfileConfiguration,AttributeResolvingProfileConfiguration,ConditionalProfileConfiguration,OverriddenIssuerProfileConfiguration,ProfileConfiguration,Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent
public class DefaultOAuth2TokenAudienceConfiguration
extends AbstractOAuth2InterceptorAwareProfileConfiguration
implements OAuth2TokenAudienceConfiguration
Implementation of an OAuth 2.0 token "audience" profile configuration.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Function<ProfileRequestContext,BiFunction<ProfileRequestContext, Map<String, Object>, Map<String, Object>>> Lookup function to supply strategy bi-function for manipulating access token claims set.private Function<ProfileRequestContext,Duration> Lookup function to supply access token lifetime.private Function<ProfileRequestContext,String> Lookup functioon to supply access token type.private Predicate<ProfileRequestContext>Whether the access token to be issued is always a bearer access token.private Predicate<ProfileRequestContext>Whether encryption is optional in the face of no key, etc.private Function<ProfileRequestContext,String> Lookup function to override issuer value.private Predicate<ProfileRequestContext>Whether attributes should be resolved in the course of the profile.private Function<ProfileRequestContext,List<String>> Lookup function to supply the resource indicators used to target the services or resources for which access is being requested.Fields inherited from interface net.shibboleth.oidc.profile.oauth2.config.OAuth2TokenAudienceConfiguration
PROFILE_ID, PROTOCOL_URIFields inherited from interface net.shibboleth.profile.config.ProfileConfiguration
DEFAULT_DISALLOWED_FEATURES -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.DefaultOAuth2TokenAudienceConfiguration(String profileId) Creates a new configuration instance. -
Method Summary
Modifier and TypeMethodDescriptiongetAccessTokenClaimsSetManipulationStrategy(ProfileRequestContext profileRequestContext) Get the bi-function for manipulating access token claims set.getAccessTokenLifetime(ProfileRequestContext profileRequestContext) Get access token lifetime.getAccessTokenType(ProfileRequestContext profileRequestContext) Get access token type.getIssuer(ProfileRequestContext profileRequestContext) getResourceIndicators(ProfileRequestContext profileRequestContext) Get the set of OAuth 2.0 resource indicators associated with the given profile request context that specify the intended audiences of an OAuth 2.0 access token.booleanisAlwaysIssueBearerAccessToken(ProfileRequestContext profileRequestContext) Get whether the access token to be issued is always a bearer access token.booleanisEncryptionOptional(ProfileRequestContext profileRequestContext) Get whether encryption is optional in the face of a missing key, etc.booleanisResolveAttributes(ProfileRequestContext profileRequestContext) voidsetAccessTokenClaimsSetManipulationStrategy(BiFunction<ProfileRequestContext, Map<String, Object>, Map<String, Object>> strategy) Set the bi-function for manipulating access token claims set.voidsetAccessTokenClaimsSetManipulationStrategyLookupStrategy(Function<ProfileRequestContext, BiFunction<ProfileRequestContext, Map<String, Object>, Map<String, Object>>> strategy) Set a lookup strategy for the bi-function for manipulating access token claims set.voidsetAccessTokenLifetime(Duration lifetime) Set the lifetime of an access token.voidSet a lookup strategy for the access token lifetime.voidsetAccessTokenType(String type) Set access token type.voidSet lookup strategy for access token type.voidsetAlwaysIssueBearerAccessToken(boolean flag) Set whether the access token to be issued is always a bearer access token.voidSet a condition to determine whether the access token to be issued is always a bearer access token.voidsetEncryptionOptional(boolean flag) Set whether encryption is optional in the face of a missing key, etc.voidSet a condition to determine whether encryption is optional in the face of a missing key, etc.voidSet overridden issuer value.voidSets lookup strategy for overridden issuer value.voidsetResolveAttributes(boolean flag) Set whether attributes should be resolved during the profile.voidSet a condition to determine whether attributes should be resolved during the profile.voidsetResourceIndicators(List<String> resourceIndicators) Set the set of OAuth 2.0 resource indicators that specify the intended audiences for an OAuth 2.0 access token.voidSet the lookup strategy used to find the set of OAuth 2.0 resource indicators associated with the given profile request context that specify the intended audiences for an OAuth 2.0 access token.Methods inherited from class net.shibboleth.oidc.profile.oauth2.config.impl.AbstractOAuth2InterceptorAwareProfileConfiguration
getMessageHandler, setMessageHandler, setMessageHandlerLookupStrategyMethods inherited from class net.shibboleth.idp.profile.config.AbstractInterceptorAwareProfileConfiguration
getInboundInterceptorFlows, getOutboundInterceptorFlows, setInboundInterceptorFlows, setInboundInterceptorFlowsLookupStrategy, setOutboundInterceptorFlows, setOutboundInterceptorFlowsLookupStrategyMethods inherited from class net.shibboleth.profile.config.AbstractConditionalProfileConfiguration
getActivationCondition, setActivationConditionMethods inherited from class net.shibboleth.profile.config.AbstractProfileConfiguration
equals, getDisallowedFeatures, getSecurityConfiguration, hashCode, isFeatureDisallowed, setDisallowedFeatures, setDisallowedFeaturesLookupStrategy, setSecurityConfiguration, setSecurityConfigurationLookupStrategyMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
setIdMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
doInitialize, ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentExceptionMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.profile.config.ConditionalProfileConfiguration
getActivationConditionMethods inherited from interface net.shibboleth.shared.component.IdentifiedComponent
getIdMethods inherited from interface net.shibboleth.idp.profile.config.InterceptorAwareProfileConfiguration
getInboundInterceptorFlows, getOutboundInterceptorFlowsMethods inherited from interface net.shibboleth.profile.config.ProfileConfiguration
getDisallowedFeatures, getSecurityConfiguration, isFeatureDisallowed
-
Field Details
-
issuerLookupStrategy
Lookup function to override issuer value. -
resolveAttributesPredicate
Whether attributes should be resolved in the course of the profile. -
encryptionOptionalPredicate
Whether encryption is optional in the face of no key, etc. -
accessTokenTypeLookupStrategy
Lookup functioon to supply access token type. -
accessTokenLifetimeLookupStrategy
Lookup function to supply access token lifetime. -
accessTokenClaimsSetManipulationStrategyLookupStrategy
@Nonnull private Function<ProfileRequestContext,BiFunction<ProfileRequestContext, accessTokenClaimsSetManipulationStrategyLookupStrategyMap<String, Object>, Map<String, Object>>> Lookup function to supply strategy bi-function for manipulating access token claims set. -
alwaysIssueBearerAccessTokenPredicate
Whether the access token to be issued is always a bearer access token. -
resourceIndicatorsLookupStrategy
Lookup function to supply the resource indicators used to target the services or resources for which access is being requested.
-
-
Constructor Details
-
DefaultOAuth2TokenAudienceConfiguration
public DefaultOAuth2TokenAudienceConfiguration()Constructor. -
DefaultOAuth2TokenAudienceConfiguration
Creates a new configuration instance.- Parameters:
profileId- Unique profile identifier.
-
-
Method Details
-
getIssuer
- Specified by:
getIssuerin interfaceOverriddenIssuerProfileConfiguration
-
setIssuer
Set overridden issuer value.- Parameters:
issuer- issuer value
-
setIssuerLookupStrategy
Sets lookup strategy for overridden issuer value.- Parameters:
strategy- lookup strategy
-
isResolveAttributes
- Specified by:
isResolveAttributesin interfaceAttributeResolvingProfileConfiguration
-
setResolveAttributes
public void setResolveAttributes(boolean flag) Set whether attributes should be resolved during the profile.- Parameters:
flag- flag to set
-
setResolveAttributesPredicate
Set a condition to determine whether attributes should be resolved during the profile.- Parameters:
condition- condition to set
-
isEncryptionOptional
Get whether encryption is optional in the face of a missing key, etc.- Specified by:
isEncryptionOptionalin interfaceOAuth2TokenEncryptionProfileConfiguration- Parameters:
profileRequestContext- current profile request context- Returns:
- true iff encryption is optional
-
setEncryptionOptional
public void setEncryptionOptional(boolean flag) Set whether encryption is optional in the face of a missing key, etc.- Parameters:
flag- flag to set
-
setEncryptionOptionalPredicate
Set a condition to determine whether encryption is optional in the face of a missing key, etc.- Parameters:
condition- condition to set
-
getAccessTokenType
@Nullable @NotEmpty public String getAccessTokenType(@Nullable ProfileRequestContext profileRequestContext) Get access token type.- Specified by:
getAccessTokenTypein interfaceOAuth2AccessTokenProducingProfileConfiguration- Parameters:
profileRequestContext- profile request context- Returns:
- access token type, or null for unspecified/opaque
-
setAccessTokenType
Set access token type.- Parameters:
type- token type, or null for unspecified/opaque
-
setAccessTokenTypeLookupStrategy
public void setAccessTokenTypeLookupStrategy(@Nonnull Function<ProfileRequestContext, String> strategy) Set lookup strategy for access token type.- Parameters:
strategy- lookup strategy
-
getAccessTokenLifetime
@Positive @Nonnull public Duration getAccessTokenLifetime(@Nullable ProfileRequestContext profileRequestContext) Get access token lifetime.Defaults to 10 minutes.
- Specified by:
getAccessTokenLifetimein interfaceOAuth2AccessTokenProducingProfileConfiguration- Parameters:
profileRequestContext- profile request context- Returns:
- access token lifetime
-
setAccessTokenLifetime
Set the lifetime of an access token.- Parameters:
lifetime- lifetime of an access token in milliseconds
-
setAccessTokenLifetimeLookupStrategy
public void setAccessTokenLifetimeLookupStrategy(@Nullable Function<ProfileRequestContext, Duration> strategy) Set a lookup strategy for the access token lifetime.- Parameters:
strategy- lookup strategy
-
getAccessTokenClaimsSetManipulationStrategy
@Nullable public BiFunction<ProfileRequestContext,Map<String, getAccessTokenClaimsSetManipulationStrategyObject>, Map<String, Object>> (@Nullable ProfileRequestContext profileRequestContext) Get the bi-function for manipulating access token claims set.- Specified by:
getAccessTokenClaimsSetManipulationStrategyin interfaceOAuth2AccessTokenProducingProfileConfiguration- Parameters:
profileRequestContext- profile request context- Returns:
- the bi-function for manipulating access token claims set
-
setAccessTokenClaimsSetManipulationStrategy
public void setAccessTokenClaimsSetManipulationStrategy(@Nullable BiFunction<ProfileRequestContext, Map<String, Object>, Map<String, Object>> strategy) Set the bi-function for manipulating access token claims set.- Parameters:
strategy- bi-function for manipulating access token claims set- Since:
- 2.2.0
-
setAccessTokenClaimsSetManipulationStrategyLookupStrategy
public void setAccessTokenClaimsSetManipulationStrategyLookupStrategy(@Nonnull Function<ProfileRequestContext, BiFunction<ProfileRequestContext, Map<String, Object>, Map<String, Object>>> strategy) Set a lookup strategy for the bi-function for manipulating access token claims set.- Parameters:
strategy- lookup strategy- Since:
- 2.2.0
-
isAlwaysIssueBearerAccessToken
public boolean isAlwaysIssueBearerAccessToken(@Nullable ProfileRequestContext profileRequestContext) Get whether the access token to be issued is always a bearer access token.- Specified by:
isAlwaysIssueBearerAccessTokenin interfaceOAuth2AccessTokenProducingProfileConfiguration- Parameters:
profileRequestContext- profile request context- Returns:
- whether the access token to be issued is always a bearer access token
-
setAlwaysIssueBearerAccessToken
public void setAlwaysIssueBearerAccessToken(boolean flag) Set whether the access token to be issued is always a bearer access token.- Parameters:
flag- flag to set- Since:
- 3.2.0
-
setAlwaysIssueBearerAccessTokenPredicate
public void setAlwaysIssueBearerAccessTokenPredicate(@Nonnull Predicate<ProfileRequestContext> condition) Set a condition to determine whether the access token to be issued is always a bearer access token.- Parameters:
condition- condition to set- Since:
- 3.2.0
-
getResourceIndicators
@Nonnull public List<String> getResourceIndicators(@Nullable ProfileRequestContext profileRequestContext) Get the set of OAuth 2.0 resource indicators associated with the given profile request context that specify the intended audiences of an OAuth 2.0 access token.TODO: Default implementation should be removed in 4.0.0
- Specified by:
getResourceIndicatorsin interfaceOAuth2ResourceIndicatingProfileConfiguration- Parameters:
profileRequestContext- the profile request context- Returns:
- the set of resource indicators.
-
setResourceIndicatorsLookupStrategy
public void setResourceIndicatorsLookupStrategy(@Nonnull Function<ProfileRequestContext, List<String>> strategy) Set the lookup strategy used to find the set of OAuth 2.0 resource indicators associated with the given profile request context that specify the intended audiences for an OAuth 2.0 access token.- Parameters:
strategy- the strategy to set.- Since:
- 3.4.0
-
setResourceIndicators
Set the set of OAuth 2.0 resource indicators that specify the intended audiences for an OAuth 2.0 access token.- Parameters:
resourceIndicators- the set of resource indicators.- Since:
- 3.4.0
-