Class DependencyAttributeSubjectResolver
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.idp.attribute.resolver.dc.saml.plugin.impl.DependencyAttributeSubjectResolver
- All Implemented Interfaces:
SubjectResolver,Component,DestructableComponent,InitializableComponent
public class DependencyAttributeSubjectResolver
extends AbstractInitializableComponent
implements SubjectResolver
An implementation of
SubjectResolver which returns a Subject using a NameID built
using the value from one of an ordered list of dependency attributes.
Dependency attributes are searched in the order specified and the first one found to have a value of a supported type will be used. Supported types are:
-
Field Summary
FieldsModifier and TypeFieldDescriptionList of dependency attribute IDs to search for a value.private StringThe default format URI used to construct the NameID if a custom format for the attribute ID is not defined ingetNameIDFormatMap().private final org.slf4j.LoggerLogger.Map allowing to customize the NameID format URI on a per-attributeID basis. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate SubjectbuildSubject(String value, String attributeID) Build a Subject using the specified string as the NameID value.private SubjectbuildSubject(NameID value) Build a Subject using the specified NameID.private StringdeterminieNameIDFormat(String attributeID) Determine the NamedID Format to use for the given dependency attribute ID.Get the list of dependency attribute IDs to search for a value.Get the default format URI used to construct the NameID if a custom format for the attribute ID is not defined ingetNameIDFormatMap().Get the map allowing to customize the NameID format URI on a per-attributeID basis.resolve(AttributeResolutionContext resolutionContext, Map<String, List<IdPAttributeValue>> dependencyAttributes, AttributeAuthorityDescriptor roleDescriptor) Resolve theSubjectto use in query.voidsetAttributeIDs(List<String> values) Set the list of dependency attribute IDs to search for a value.voidSet the default format URI used to construct the NameID if a custom format for the attribute ID is not defined ingetNameIDFormatMap().voidsetNameIDFormatMap(Map<String, String> formatMap) Set the map allowing to customize the NameID format URI on a per-attributeID basis.Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, doInitialize, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitialized
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logLogger. -
attributeIDs
List of dependency attribute IDs to search for a value. -
nameIDFormatMap
Map allowing to customize the NameID format URI on a per-attributeID basis. -
defaultNameIDFormat
The default format URI used to construct the NameID if a custom format for the attribute ID is not defined ingetNameIDFormatMap().
-
-
Constructor Details
-
DependencyAttributeSubjectResolver
public DependencyAttributeSubjectResolver()
-
-
Method Details
-
getAttributeIDs
Get the list of dependency attribute IDs to search for a value.- Returns:
- the list of attribute IDs, may be empty
-
setAttributeIDs
Set the list of dependency attribute IDs to search for a value.- Parameters:
values- the list of attribute IDs
-
getNameIDFormatMap
Get the map allowing to customize the NameID format URI on a per-attributeID basis.- Returns:
- the custom format map
-
setNameIDFormatMap
Set the map allowing to customize the NameID format URI on a per-attributeID basis.- Parameters:
formatMap- the custom format map
-
getDefaultNameIDFormat
Get the default format URI used to construct the NameID if a custom format for the attribute ID is not defined ingetNameIDFormatMap().- Returns:
- the format URI
-
setDefaultNameIDFormat
Set the default format URI used to construct the NameID if a custom format for the attribute ID is not defined ingetNameIDFormatMap().- Parameters:
uri- the format URI
-
resolve
@Nullable public Subject resolve(@Nonnull AttributeResolutionContext resolutionContext, @Nonnull Map<String, List<IdPAttributeValue>> dependencyAttributes, @Nonnull AttributeAuthorityDescriptor roleDescriptor) throws ResolutionExceptionResolve theSubjectto use in query.- Specified by:
resolvein interfaceSubjectResolver- Parameters:
resolutionContext- the attribute resolution context in effect for the querydependencyAttributes- the dependency attributes in effect for the queryroleDescriptor- the attribute authority role descriptor for the query- Returns:
- the subject, may be null
- Throws:
ResolutionException- if there is a fatal error during processing
-
buildSubject
Build a Subject using the specified string as the NameID value.- Parameters:
value- the string valueattributeID- the attribute ID which contained the specified value- Returns:
- newly constructed Subject instance
-
buildSubject
Build a Subject using the specified NameID.- Parameters:
value- the NameID value- Returns:
- newly constructed Subject instance, or null if there was a fatal error cloning the input NameID
-
determinieNameIDFormat
Determine the NamedID Format to use for the given dependency attribute ID.- Parameters:
attributeID- the attribute ID to process- Returns:
- the NameID Format to use for attributes of the specified ID
-