Class OIDCScopedStringAttributeTranscoder
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.idp.attribute.transcoding.AbstractAttributeTranscoder<JSONObject>
net.shibboleth.oidc.attribute.transcoding.AbstractOIDCAttributeTranscoder
net.shibboleth.oidc.attribute.transcoding.impl.OIDCScopedStringAttributeTranscoder
- All Implemented Interfaces:
AttributeTranscoder<JSONObject>,OIDCAttributeTranscoder,Component,DestructableComponent,InitializableComponent
Class encoding scoped string attributes to string json object. Name of the attribute will be set as the key. The
string contains attribute value, delimiter and scope concatenated. If there are several attribute values they are
delimited with delimiter(space is default) or placed to array.
For decoding, JSON Strings are split by the delimiter into a ScopedStringAttributeValue. For JSON Arrays,
the elements are recessively visited and any JSON Strings are split by their delimiter into a list of
ScopedStringAttributeValues.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.shibboleth.oidc.attribute.transcoding.AbstractOIDCAttributeTranscoder
AbstractOIDCAttributeTranscoder.NamingFunction -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.slf4j.LoggerClass logger.static final StringScope delimiter for combining the data.Fields inherited from interface net.shibboleth.oidc.attribute.transcoding.OIDCAttributeTranscoder
METADATA_TAG_NAME, PROP_ARRAY_AS_STRING, PROP_ASARRAY, PROP_ASBOOLEAN, PROP_ASINTEGER, PROP_BOOLEAN_AS_STRING, PROP_NAME, PROP_NAME_FROM_METADATA, PROP_NUMBER_AS_STRING, PROP_STRING_DELIMITER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected List<IdPAttributeValue>decodeValues(ProfileRequestContext profileRequestContext, Object input, TranscodingRule rule) Subclasses should override this method to perform specific claim value decoding intoIdPAttributeValueobjects.protected ObjectencodeValues(ProfileRequestContext profileRequestContext, IdPAttribute attribute, TranscodingRule rule) Performs encoding ofIdPAttribute's values based on rule into a claim value.Methods inherited from class net.shibboleth.oidc.attribute.transcoding.AbstractOIDCAttributeTranscoder
buildClaim, buildIdPAttribute, doDecode, doEncode, getEncodedName, getEncodedName, getEncodedType, getNameFromMetadata, setNameFromMetadataLookupStrategyMethods inherited from class net.shibboleth.idp.attribute.transcoding.AbstractAttributeTranscoder
decode, encode, setActivationConditionMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, doInitialize, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.idp.attribute.transcoding.AttributeTranscoder
decode, encodeMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitialized
-
Field Details
-
PROP_SCOPE_DELIMITER
Scope delimiter for combining the data.- See Also:
-
log
@Nonnull private final org.slf4j.Logger logClass logger.
-
-
Constructor Details
-
OIDCScopedStringAttributeTranscoder
public OIDCScopedStringAttributeTranscoder()
-
-
Method Details
-
encodeValues
@Nullable protected Object encodeValues(@Nullable ProfileRequestContext profileRequestContext, @Nonnull IdPAttribute attribute, @Nonnull TranscodingRule rule) throws AttributeEncodingException Performs encoding ofIdPAttribute's values based on rule into a claim value.- Specified by:
encodeValuesin classAbstractOIDCAttributeTranscoder- Parameters:
profileRequestContext- current profile requestattribute- the attribute being encodedrule- properties to control encoding- Returns:
- Integer, Boolean, String, JSON Array or JSON Object value for claim
- Throws:
AttributeEncodingException- if there's a problem encoding the values
-
decodeValues
@Nonnull protected List<IdPAttributeValue> decodeValues(@Nullable ProfileRequestContext profileRequestContext, @Nonnull Object input, @Nonnull TranscodingRule rule) throws AttributeDecodingException Subclasses should override this method to perform specific claim value decoding intoIdPAttributeValueobjects.- Specified by:
decodeValuesin classAbstractOIDCAttributeTranscoder- Parameters:
profileRequestContext- current profile request contextinput- the raw claim valuerule- properties to control decoding- Returns:
- a possibly empty list of decoded values
- Throws:
AttributeDecodingException- if there's a problem decoding the claim value
-