Class LocalJOSEObjectCredentialResolver
java.lang.Object
org.opensaml.security.credential.impl.AbstractCredentialResolver
org.opensaml.security.credential.impl.AbstractCriteriaFilteringCredentialResolver
net.shibboleth.oidc.security.credential.impl.BasicJOSEObjectCredentialResolver
net.shibboleth.oidc.security.credential.impl.LocalJOSEObjectCredentialResolver
- All Implemented Interfaces:
JOSEObjectCredentialResolver,Resolver<Credential,,CriteriaSet> CredentialResolver
A simple specialization of
BasicJOSEObjectCredentialResolver
which is capable of resolving local credentials from a supplied CredentialResolver
which manages local credentials.
The local credential resolver supplied should manage and return credentials which contain either a secret (symmetric) key or the private key half of a key pair.
A typical use case for this class would be as a resolver of decryption keys,
such as is needed by JWETokenDecrypter}.
Resolution proceeds as follows:
- Any credential resolved via the standard
BasicJOSEObjectCredentialResolverresolution process which is a local credential (contains private key) will be removed from the effective set of credentials to be returned. - If a credential so removed contained a public key, that key will be used as a resolution criteria input to the local credential resolver (along with the keyID 'kid' if one exists in the JOSE headers). Any local credentials so resolved will be added to the set to be returned.
- Similarly, the keyID 'kid' from the JOSE headers will also be used as resolution criteria for local credentials and the resultant credentials added to the set to be returned providing they do not share the same private and public key pair as one already resolved - avoiding key duplication in the result.
- Since:
- 2.2.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final JOSEObjectCredentialResolverThe resolver which is used to resolve local credentials.private final org.slf4j.LoggerClass logger. -
Constructor Summary
ConstructorsConstructorDescriptionLocalJOSEObjectCredentialResolver(JOSEObjectCredentialResolver localCredentialResolver) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionGet the resolver for local credentials.protected booleanisLocalCredential(Credential credential) Determine whether the credential is a local credential.protected voidpostProcess(CriteriaSet criteriaSet, JOSEObject joseObject, List<Credential> credentials) Hook for subclasses to do post-processing of the credential set after all JOSE header keys have been processed.private StringresolveKeyIdFromJoseHeader(Header header) private List<Credential>resolveLocalCredentialsByCriteria(CriteriaSet criteriaSet) Resolve credentials using thelocalCredResolverand the supplied criteria.Methods inherited from class net.shibboleth.oidc.security.credential.impl.BasicJOSEObjectCredentialResolver
buildJWKCredential, deriveClientSecretCredential, extractKeyIdFromCriteria, populateCredentialsFromKeySet, processJWEHeader, processJWSHeader, resolveFromSourceMethods inherited from class org.opensaml.security.credential.impl.AbstractCriteriaFilteringCredentialResolver
isSatisfyAllPredicates, resolve, setSatisfyAllPredicatesMethods inherited from class org.opensaml.security.credential.impl.AbstractCredentialResolver
resolveSingleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.resolver.Resolver
resolve, resolveSingle
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
localCredResolver
The resolver which is used to resolve local credentials.
-
-
Constructor Details
-
LocalJOSEObjectCredentialResolver
public LocalJOSEObjectCredentialResolver(@Nonnull @ParameterName(name="localCredentialResolver") JOSEObjectCredentialResolver localCredentialResolver) Constructor.- Parameters:
localCredentialResolver- resolver of local credentials
-
-
Method Details
-
getLocalCredentialResolver
Get the resolver for local credentials. The credentials managed and returned by this resolver should all contain either a secret (symmetric) or private key.- Returns:
- resolver of local credentials
-
resolveKeyIdFromJoseHeader
- Parameters:
header- the JOSE header to find a kid from- Returns:
- the keyId or null
-
isLocalCredential
Determine whether the credential is a local credential. A local credential will have either a private key or a secret (symmetric) key.- Parameters:
credential- the credential to evaluate- Returns:
- true if the credential has either a private or secret key, false otherwise
-