Class AbstractOIDCAttributeTranscoder
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- net.shibboleth.idp.attribute.transcoding.AbstractAttributeTranscoder<net.minidev.json.JSONObject>
-
- net.shibboleth.oidc.attribute.transcoding.AbstractOIDCAttributeTranscoder
-
- All Implemented Interfaces:
net.shibboleth.idp.attribute.transcoding.AttributeTranscoder<net.minidev.json.JSONObject>,OIDCAttributeTranscoder,Component,DestructableComponent,InitializableComponent
public abstract class AbstractOIDCAttributeTranscoder extends net.shibboleth.idp.attribute.transcoding.AbstractAttributeTranscoder<net.minidev.json.JSONObject> implements OIDCAttributeTranscoder
Abstract class for OIDC attribute encoders.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractOIDCAttributeTranscoder.NamingFunctionA function to produce a "canonical" name for an OIDC claim for transcoding rules.
-
Field Summary
Fields Modifier and Type Field Description private org.slf4j.LoggerlogClass logger.-
Fields inherited from interface net.shibboleth.oidc.attribute.transcoding.OIDCAttributeTranscoder
PROP_ARRAY_AS_STRING, PROP_ASARRAY, PROP_ASBOOLEAN, PROP_ASINTEGER, PROP_BOOLEAN_AS_STRING, PROP_NAME, PROP_NUMBER_AS_STRING, PROP_STRING_DELIMITER
-
-
Constructor Summary
Constructors Constructor Description AbstractOIDCAttributeTranscoder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected net.minidev.json.JSONObjectbuildClaim(ProfileRequestContext profileRequestContext, net.shibboleth.idp.attribute.IdPAttribute attribute, net.shibboleth.idp.attribute.transcoding.TranscodingRule rule, Object claimValues)Builds an OIDC claim structure with the given values.protected net.shibboleth.idp.attribute.IdPAttributebuildIdPAttribute(ProfileRequestContext profileRequestContext, net.minidev.json.JSONObject claim, net.shibboleth.idp.attribute.transcoding.TranscodingRule rule, List<net.shibboleth.idp.attribute.IdPAttributeValue> attributeValues)Builds anIdPAttributefrom the given values.protected abstract List<net.shibboleth.idp.attribute.IdPAttributeValue>decodeValues(ProfileRequestContext profileRequestContext, Object input, net.shibboleth.idp.attribute.transcoding.TranscodingRule rule)Subclasses should override this method to perform specific claim value decoding intoIdPAttributeValueobjects.net.shibboleth.idp.attribute.IdPAttributedoDecode(ProfileRequestContext profileRequestContext, net.minidev.json.JSONObject input, net.shibboleth.idp.attribute.transcoding.TranscodingRule rule)net.minidev.json.JSONObjectdoEncode(ProfileRequestContext profileRequestContext, net.shibboleth.idp.attribute.IdPAttribute attribute, Class<? extends net.minidev.json.JSONObject> to, net.shibboleth.idp.attribute.transcoding.TranscodingRule rule)protected abstract ObjectencodeValues(ProfileRequestContext profileRequestContext, net.shibboleth.idp.attribute.IdPAttribute attribute, net.shibboleth.idp.attribute.transcoding.TranscodingRule rule)Performs encoding ofIdPAttribute's values based on rule into a claim value.StringgetEncodedName(net.shibboleth.idp.attribute.transcoding.TranscodingRule rule)Class<net.minidev.json.JSONObject>getEncodedType()-
Methods inherited from class net.shibboleth.idp.attribute.transcoding.AbstractAttributeTranscoder
decode, encode, setActivationCondition
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, doInitialize, initialize, isDestroyed, isInitialized
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.shibboleth.idp.attribute.transcoding.AttributeTranscoder
decode, encode
-
Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent
initialize, isInitialized
-
-
-
-
Method Detail
-
getEncodedType
public Class<net.minidev.json.JSONObject> getEncodedType()
- Specified by:
getEncodedTypein interfacenet.shibboleth.idp.attribute.transcoding.AttributeTranscoder<net.minidev.json.JSONObject>
-
getEncodedName
@Nullable public String getEncodedName(@Nonnull net.shibboleth.idp.attribute.transcoding.TranscodingRule rule)
- Specified by:
getEncodedNamein interfacenet.shibboleth.idp.attribute.transcoding.AttributeTranscoder<net.minidev.json.JSONObject>
-
doEncode
@Nullable public net.minidev.json.JSONObject doEncode(@Nullable ProfileRequestContext profileRequestContext, @Nonnull net.shibboleth.idp.attribute.IdPAttribute attribute, @Nonnull Class<? extends net.minidev.json.JSONObject> to, @Nonnull net.shibboleth.idp.attribute.transcoding.TranscodingRule rule) throws net.shibboleth.idp.attribute.AttributeEncodingException- Specified by:
doEncodein classnet.shibboleth.idp.attribute.transcoding.AbstractAttributeTranscoder<net.minidev.json.JSONObject>- Throws:
net.shibboleth.idp.attribute.AttributeEncodingException
-
buildClaim
@Nonnull protected net.minidev.json.JSONObject buildClaim(@Nullable ProfileRequestContext profileRequestContext, @Nullable net.shibboleth.idp.attribute.IdPAttribute attribute, @Nonnull net.shibboleth.idp.attribute.transcoding.TranscodingRule rule, @Nonnull @NonnullElements Object claimValues) throws net.shibboleth.idp.attribute.AttributeEncodingExceptionBuilds an OIDC claim structure with the given values.- Parameters:
profileRequestContext- current profile request contextattribute- the attribute being encodedrule- properties to control encodingclaimValues- the encoded value(s) for the claim- Returns:
- the OIDC claim (for the moment in the form of a single-valued JSON structure
- Throws:
net.shibboleth.idp.attribute.AttributeEncodingException- if there's a problem constructing the claim
-
encodeValues
@Nullable protected abstract Object encodeValues(@Nullable ProfileRequestContext profileRequestContext, @Nonnull net.shibboleth.idp.attribute.IdPAttribute attribute, @Nonnull net.shibboleth.idp.attribute.transcoding.TranscodingRule rule) throws net.shibboleth.idp.attribute.AttributeEncodingException
Performs encoding ofIdPAttribute's values based on rule into a claim value.- 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:
net.shibboleth.idp.attribute.AttributeEncodingException- if there's a problem encoding the values
-
doDecode
@Nullable public net.shibboleth.idp.attribute.IdPAttribute doDecode(@Nullable ProfileRequestContext profileRequestContext, @Nonnull net.minidev.json.JSONObject input, @Nonnull net.shibboleth.idp.attribute.transcoding.TranscodingRule rule) throws net.shibboleth.idp.attribute.AttributeDecodingException- Specified by:
doDecodein classnet.shibboleth.idp.attribute.transcoding.AbstractAttributeTranscoder<net.minidev.json.JSONObject>- Throws:
net.shibboleth.idp.attribute.AttributeDecodingException
-
buildIdPAttribute
@Nonnull protected net.shibboleth.idp.attribute.IdPAttribute buildIdPAttribute(@Nullable ProfileRequestContext profileRequestContext, @Nonnull net.minidev.json.JSONObject claim, @Nonnull net.shibboleth.idp.attribute.transcoding.TranscodingRule rule, @Nonnull @NonnullElements List<net.shibboleth.idp.attribute.IdPAttributeValue> attributeValues) throws net.shibboleth.idp.attribute.AttributeDecodingExceptionBuilds anIdPAttributefrom the given values.- Parameters:
profileRequestContext- current profile requestclaim- the claim being decodedrule- properties to control decodingattributeValues- the decoded values for the attribute- Returns:
- the IdPAttribute object
- Throws:
net.shibboleth.idp.attribute.AttributeDecodingException- if there's a problem constructing the IdPAttribute
-
decodeValues
@Nonnull @NonnullElements protected abstract List<net.shibboleth.idp.attribute.IdPAttributeValue> decodeValues(@Nullable ProfileRequestContext profileRequestContext, @Nonnull Object input, @Nonnull net.shibboleth.idp.attribute.transcoding.TranscodingRule rule) throws net.shibboleth.idp.attribute.AttributeDecodingException
Subclasses should override this method to perform specific claim value decoding intoIdPAttributeValueobjects.- Parameters:
profileRequestContext- current profile request contextinput- the raw claim valuerule- properties to control decoding- Returns:
- a possibly empty list of decoded values
- Throws:
net.shibboleth.idp.attribute.AttributeDecodingException- if there's a problem decoding the claim value
-
-