Class ClientAuthenticationConfigurationLookupFunction
- java.lang.Object
-
- net.shibboleth.idp.plugin.authn.oidc.rp.security.impl.ClientAuthenticationConfigurationLookupFunction
-
- All Implemented Interfaces:
Function<MessageContext,List<SignatureSigningConfiguration>>,ContextDataLookupFunction<MessageContext,List<SignatureSigningConfiguration>>
public class ClientAuthenticationConfigurationLookupFunction extends Object implements ContextDataLookupFunction<MessageContext,List<SignatureSigningConfiguration>>
A function that returns aSignatureSigningConfigurationlist for signing client authentication JWTs.The configuration list is taken from the active security configuration, but the algorithms are filtered to only allow those that are compatible with the client authentication type chosen. For example, the HMAC family of algorithms if the client_secret_jwt method is used.
-
-
Field Summary
Fields Modifier and Type Field Description private org.slf4j.LoggerlogClass logger.private static ParentProfileRequestContextLookup<MessageContext>PRC_LOOKUPLookup function for parent ProfileRequestContext.private Function<ProfileRequestContext,RelyingPartyContext>relyingPartyContextLookupStrategyStrategy used to locate theRelyingPartyContextassociated with a givenProfileRequestContext.private RelyingPartyConfigurationResolverrpResolverA resolver for default security configurations.
-
Constructor Summary
Constructors Constructor Description ClientAuthenticationConfigurationLookupFunction()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<SignatureSigningConfiguration>apply(MessageContext input)private BasicSignatureSigningConfigurationcreateSignatureSigningConfiguration(SignatureSigningConfiguration signingConfig, List<String> algorithms)Create a copy of the signature signing configuration given, but replace the algorithms with those input.private List<String>filterAlgorithmsAgainstFamily(com.nimbusds.jose.JWSAlgorithm.Family algFamily, List<String> algorithms)Filter out any algorithms in the list that are not from the given algorithm family.voidsetRelyingPartyConfigurationResolver(RelyingPartyConfigurationResolver resolver)Set the resolver for default security configurations.voidsetRelyingPartyContextLookupStrategy(Function<ProfileRequestContext,RelyingPartyContext> strategy)Set the strategy used to locate theRelyingPartyContextassociated with a givenProfileRequestContext.
-
-
-
Field Detail
-
PRC_LOOKUP
@Nonnull private static final ParentProfileRequestContextLookup<MessageContext> PRC_LOOKUP
Lookup function for parent ProfileRequestContext.
-
log
@Nonnull private final org.slf4j.Logger log
Class logger.
-
relyingPartyContextLookupStrategy
@Nonnull private Function<ProfileRequestContext,RelyingPartyContext> relyingPartyContextLookupStrategy
Strategy used to locate theRelyingPartyContextassociated with a givenProfileRequestContext.
-
rpResolver
@Nullable private RelyingPartyConfigurationResolver rpResolver
A resolver for default security configurations.
-
-
Method Detail
-
setRelyingPartyConfigurationResolver
public void setRelyingPartyConfigurationResolver(@Nullable RelyingPartyConfigurationResolver resolver)Set the resolver for default security configurations.- Parameters:
resolver- the resolver to use
-
setRelyingPartyContextLookupStrategy
public void setRelyingPartyContextLookupStrategy(@Nonnull Function<ProfileRequestContext,RelyingPartyContext> strategy)Set the strategy used to locate theRelyingPartyContextassociated with a givenProfileRequestContext.- Parameters:
strategy- lookup strategy
-
apply
@Nonnull @NonnullElements @NotLive @Unmodifiable public List<SignatureSigningConfiguration> apply(@Nullable MessageContext input)
- Specified by:
applyin interfaceFunction<MessageContext,List<SignatureSigningConfiguration>>
-
filterAlgorithmsAgainstFamily
@Nonnull @NonnullElements @NotLive @Unmodifiable private List<String> filterAlgorithmsAgainstFamily(@Nonnull com.nimbusds.jose.JWSAlgorithm.Family algFamily, @Nullable List<String> algorithms)
Filter out any algorithms in the list that are not from the given algorithm family.- Parameters:
algFamily- the algorithm family to filter onalgorithms- the algorithms to filter- Returns:
- a filtered list of algorithms
-
createSignatureSigningConfiguration
@Nonnull private BasicSignatureSigningConfiguration createSignatureSigningConfiguration(@Nonnull SignatureSigningConfiguration signingConfig, @Nonnull List<String> algorithms)
Create a copy of the signature signing configuration given, but replace the algorithms with those input.- Parameters:
signingConfig- the signature signing configuration to copyalgorithms- the algorithms to add into the copied configuration- Returns:
- a copied signature signing configuration with the algorithms input
-
-