Class ClientInformationNodeProcessor
java.lang.Object
net.shibboleth.oidc.metadata.impl.ClientInformationNodeProcessor
- All Implemented Interfaces:
MetadataNodeProcessor
An implementation of
MetadataNodeProcessor which supports adding an instance of
OIDCClientInformation to the object metadata of SPSSODescriptor. The data
is fetched mainly via OAuthRPExtensions.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classAbstract base class that fills in some operations. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe SLO binding identifier matching to the back-channel uri.static final StringThe SLO binding identifier matching to the front-channel uri.static final StringThe ACS binding identifier matching to the redirect_uri.private final KeyInfoCredentialResolverTheKeyInfoCredentialResolverto be used for the resolution.private final org.slf4j.LoggerClass logger. -
Constructor Summary
ConstructorsConstructorDescriptionClientInformationNodeProcessor(List<KeyInfoProvider> keyInfoProviders) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<String>getListValues(String metadataValue) Parse an XML value list from a metadata value object into a collection of strings.protected OAuthRPExtensionsgetOAuthRPExtensions(SPSSODescriptor roleDescriptor) Get theOAuthRPExtensionsfrom the givenSPSSODescriptor, it it was found from its extensions.protected URIgetSingleURIValue(String value) protected URIgetSingleURIValue(MetadataValueSAMLObject metadataValue) Converts the metadata value object value into aURI.protected ApplicationTypeparseApplicationType(OAuthRPExtensions extensions) Parse theApplicationTypefrom the given extensions.parseAudiences(OAuthRPExtensions extensions) Parse the SAML Audience elements.protected ClientAuthenticationMethodparseClientAuthenticationMethod(OAuthRPExtensions extensions) Parse theClientAuthenticationMethodfrom the given extensions.protected ClientIDparseClientID(SPSSODescriptor roleDescriptor) Converts the entityID of the givenSPSSODescriptorinto aClientID.protected SecretparseClientSecret(Iterable<Credential> credentials) Fetches the client secret from given the set ofCredentials.parseDefaultAcrValues(OAuthRPExtensions extensions) Parse the defaultACRvalues from the given extensions.protected EncryptionMethodparseEncryptionMethod(String value) Parse theEncryptionMethodfrom the given metadata value.parseGrantTypes(OAuthRPExtensions extensions) Parse theGrantTypes from the given extensions.protected JWEAlgorithmparseJweAlgorithm(String value) Parse theJWEAlgorithmfrom the given metadata value.protected JWKSetparseJwkSet(Iterable<Credential> credentials, String clientId) Convert the given credentials into the NimbusJWKSet.protected URIparseJwkUri(Iterable<Credential> credentials, String clientId) Convert the given credentials into a JWKS URI.protected JWSAlgorithmparseJwsAlgorithm(String value) Parse theJWSAlgorithmfrom the given metadata value.parseLogoutUris(SPSSODescriptor roleDescriptor, String binding) Parse the single logout URIs from the given role descriptor.parseRedirectUris(SPSSODescriptor roleDescriptor) Parse the redirection URIs from the given role descriptor.protected Set<ResponseType>parseResponseTypes(OAuthRPExtensions extensions) Parse theResponseTypes from the given extensions.protected ScopeparseScopes(OAuthRPExtensions extensions) Parse theScopefrom the given extensions.protected SubjectTypeparseSubjectType(SPSSODescriptor roleDescriptor) Parse theSubjectTypefrom the given role descriptor's name ID formats.parseUris(List<? extends MetadataValueSAMLObject> listOfValues) Parse the URIs from the given list of metadata values.protected OIDCClientMetadatapopulateMetadata(SPSSODescriptor roleDescriptor, Iterable<Credential> credentials, String clientId) Populates theOIDCClientMetadatausing the values found from the givenSPSSODescriptor, the set ofCredentials and the client ID.voidprotected Iterable<Credential>resolveCredentials(SPSSODescriptor roleDescriptor) Get all the credentials attached to the givenSPSSODescriptor.
-
Field Details
-
BINDING_ID_REDIRECT_URI
The ACS binding identifier matching to the redirect_uri.- See Also:
-
BINDING_ID_FRONT_SLO_URI
The SLO binding identifier matching to the front-channel uri.- See Also:
-
BINDING_ID_BACK_SLO_URI
The SLO binding identifier matching to the back-channel uri.- See Also:
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
keyInfoCredentialResolver
TheKeyInfoCredentialResolverto be used for the resolution.
-
-
Constructor Details
-
ClientInformationNodeProcessor
Constructor.- Parameters:
keyInfoProviders- The list of key info providers.
-
-
Method Details
-
process
- Specified by:
processin interfaceMetadataNodeProcessor- Throws:
FilterException
-
parseClientID
Converts the entityID of the givenSPSSODescriptorinto aClientID. The value is fetched from theEntityDescriptor, expected to be the parent element of the given role decriptor.- Parameters:
roleDescriptor- TheSPSSODescriptorto be used as a source.- Returns:
- The entityID value as
ClientID.
-
parseClientSecret
Fetches the client secret from given the set ofCredentials. The first credential matching the typeNimbusSecretCredentialis used as the source.- Parameters:
credentials- The source set ofCredentials.- Returns:
- The client secret as
Secret.
-
populateMetadata
@Nonnull protected OIDCClientMetadata populateMetadata(@Nonnull SPSSODescriptor roleDescriptor, @Nonnull Iterable<Credential> credentials, @Nonnull String clientId) Populates theOIDCClientMetadatausing the values found from the givenSPSSODescriptor, the set ofCredentials and the client ID.- Parameters:
roleDescriptor- TheSPSSODescriptorto be used as a source.credentials- The source set ofCredentials to be used for client secret and remote/local JWKS.clientId- The client ID.- Returns:
- The
OIDCClientMetadataparsed from the given parameters.
-
getOAuthRPExtensions
Get theOAuthRPExtensionsfrom the givenSPSSODescriptor, it it was found from its extensions.- Parameters:
roleDescriptor- The role descriptor to get the extensions from.- Returns:
- The extensions, if they were found from the role descriptor.
nullotherwise.
-
resolveCredentials
Get all the credentials attached to the givenSPSSODescriptor. They are resolved using thekeyInfoCredentialResolver.- Parameters:
roleDescriptor- The role descriptor to parse the credentials from.- Returns:
- All the resolved credentials. Or empty set if none was found.
-
parseJwkSet
@Nullable protected JWKSet parseJwkSet(@Nonnull Iterable<Credential> credentials, @Nonnull String clientId) Convert the given credentials into the NimbusJWKSet.- Parameters:
credentials- The set to be converted.clientId- The client ID related to the credentials.- Returns:
- The given credentials converted into a JWKSet.
-
parseJwkUri
@Nullable protected URI parseJwkUri(@Nonnull Iterable<Credential> credentials, @Nonnull String clientId) Convert the given credentials into a JWKS URI.- Parameters:
credentials- The set to be converted.clientId- The client ID related to the credentials.- Returns:
- The given credentials converted into a JWKS URI
-
parseClientAuthenticationMethod
@Nullable protected ClientAuthenticationMethod parseClientAuthenticationMethod(@Nonnull OAuthRPExtensions extensions) Parse theClientAuthenticationMethodfrom the given extensions.- Parameters:
extensions- The extensions to parse from.- Returns:
- The client authentication method, or
nullit was not found.
-
parseApplicationType
Parse theApplicationTypefrom the given extensions.- Parameters:
extensions- The extensions to parse from.- Returns:
ApplicationType.NATIVEif it was defined in the extensions,ApplicationType.WEBotherwise.
-
parseSubjectType
Parse theSubjectTypefrom the given role descriptor's name ID formats.- Parameters:
roleDescriptor- The role descriptor to parse from. Only the first nameID definition is taken into consideration.- Returns:
SubjectType.PAIRWISEifpairwisewas defined as the name ID format.SubjectType.PUBLICotherwise.
-
parseDefaultAcrValues
Parse the defaultACRvalues from the given extensions.- Parameters:
extensions- The extensions to parse from.- Returns:
- The list of ACR values that were found.
-
parseGrantTypes
Parse theGrantTypes from the given extensions.- Parameters:
extensions- The extensions to parse from.- Returns:
- The set of grant types that were found.
-
parseResponseTypes
Parse theResponseTypes from the given extensions.- Parameters:
extensions- The extensions to parse from.- Returns:
- The set of response types that were found.
-
parseScopes
Parse theScopefrom the given extensions.- Parameters:
extensions- The extensions to parse from.- Returns:
- The scope that was found.
-
parseJweAlgorithm
Parse theJWEAlgorithmfrom the given metadata value.- Parameters:
value- The metadata value to parse from.- Returns:
- The JWE algorithm, or
nullif no value was found.
-
parseJwsAlgorithm
Parse theJWSAlgorithmfrom the given metadata value.- Parameters:
value- The metadata value to parse from.- Returns:
- The JWS algorithm, or
nullif no value was found.
-
parseEncryptionMethod
Parse theEncryptionMethodfrom the given metadata value.- Parameters:
value- The metadata value to parse from.- Returns:
- The encryption method, or
nullif no value was found.
-
parseRedirectUris
Parse the redirection URIs from the given role descriptor. Only the assertion consumer service URLs whose binding matches toBINDING_ID_REDIRECT_URIare taken into consideration.- Parameters:
roleDescriptor- The role descriptor to parse from.- Returns:
- The set of redirection URIs that were successfully parsed.
-
parseUris
@Nonnull protected Set<URI> parseUris(@Nonnull List<? extends MetadataValueSAMLObject> listOfValues) Parse the URIs from the given list of metadata values.- Parameters:
listOfValues- The list to parse from.- Returns:
- Set of URIs that were successfully parsed from the list.
-
parseAudiences
@Nullable @NonnullElements protected List<String> parseAudiences(@Nonnull OAuthRPExtensions extensions) Parse the SAML Audience elements.- Parameters:
extensions- extension container- Returns:
- audience collection or null
-
parseLogoutUris
@Nonnull protected Set<URI> parseLogoutUris(@Nonnull SPSSODescriptor roleDescriptor, @Nonnull String binding) Parse the single logout URIs from the given role descriptor. Only the single logout service URLs whose binding matches to the one given in the parameters are taken into consideration.- Parameters:
roleDescriptor- The role descriptor to parse from.binding- The binding to look after.- Returns:
- The set of single logout URIs that were successfully parsed.
-
getListValues
@Nonnull @NonnullElements protected Collection<String> getListValues(@Nullable String metadataValue) Parse an XML value list from a metadata value object into a collection of strings.- Parameters:
metadataValue- input object- Returns:
- possibly empty value collection
-
getSingleURIValue
Converts the metadata value object value into aURI.- Parameters:
metadataValue- The metadata object value to convert from.- Returns:
- The value as URI if it was successfully parsed,
nullotherwise.
-
getSingleURIValue
- Parameters:
value- The raw string value.- Returns:
- The value as URI if it was successfully parsed,
nullotherwise.
-