Class AbstractOIDCAttributeTranscoder

java.lang.Object
net.shibboleth.shared.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.
  • Field Details

    • log

      @Nonnull private final org.slf4j.Logger log
      Class logger.
  • Constructor Details

    • AbstractOIDCAttributeTranscoder

      public AbstractOIDCAttributeTranscoder()
  • Method Details

    • getEncodedType

      public Class<net.minidev.json.JSONObject> getEncodedType()
      Specified by:
      getEncodedType in interface net.shibboleth.idp.attribute.transcoding.AttributeTranscoder<net.minidev.json.JSONObject>
    • getEncodedName

      @Nullable public String getEncodedName(@Nonnull net.shibboleth.idp.attribute.transcoding.TranscodingRule rule)
      Specified by:
      getEncodedName in interface net.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:
      doEncode in class net.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.AttributeEncodingException
      Builds an OIDC claim structure with the given values.
      Parameters:
      profileRequestContext - current profile request context
      attribute - the attribute being encoded
      rule - properties to control encoding
      claimValues - 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 of IdPAttribute's values based on rule into a claim value.
      Parameters:
      profileRequestContext - current profile request
      attribute - the attribute being encoded
      rule - 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:
      doDecode in class net.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.AttributeDecodingException
      Builds an IdPAttribute from the given values.
      Parameters:
      profileRequestContext - current profile request
      claim - the claim being decoded
      rule - properties to control decoding
      attributeValues - 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 into IdPAttributeValue objects.
      Parameters:
      profileRequestContext - current profile request context
      input - the raw claim value
      rule - 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