Class SAMLEncoderSupport
java.lang.Object
net.shibboleth.idp.saml.attribute.transcoding.SAMLEncoderSupport
Support class for encoding IdP Attributes and their value.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic XMLObjectencodeByteArrayValue(IdPAttribute attribute, QName attributeValueElementName, byte[] value, boolean withType) Base64 encodes abyte[]into a SAML attribute value element.static XMLObjectencodeDateTimeValue(IdPAttribute attribute, QName attributeValueElementName, Instant value, boolean withType) Encodes a date/time value into a SAML attribute value element.static XMLObjectencodeScopedStringValueAttribute(IdPAttribute attribute, QName attributeValueElementName, ScopedStringAttributeValue value, String scopeAttributeName, boolean withType) Encode aScopedStringAttributeValuevalue in to an SAML attribute value element using the (older Shibboleth) sytnax where the scope is inside an XML attribute.static XMLObjectencodeScopedStringValueInline(IdPAttribute attribute, QName attributeValueElementName, ScopedStringAttributeValue value, String scopeDelimiter, boolean withType) Encode aScopedStringAttributeValuevalue into a SAML attribute value element using the "inline" syntax where the scope and value are combined into a string.static XMLObjectencodeStringValue(IdPAttribute attribute, QName attributeValueElementName, String value, boolean withType) Encodes a String value into a SAML attribute value element.static XMLObjectencodeXMLObjectValue(IdPAttribute attribute, QName attributeValueElementName, XMLObject value)
-
Field Details
-
LOG
@Nonnull private static final org.slf4j.Logger LOGClass logger.
-
-
Constructor Details
-
SAMLEncoderSupport
private SAMLEncoderSupport()Constructor.
-
-
Method Details
-
encodeStringValue
@Nullable public static XMLObject encodeStringValue(@Nonnull IdPAttribute attribute, @Nonnull QName attributeValueElementName, @Nullable String value, boolean withType) Encodes a String value into a SAML attribute value element.- Parameters:
attribute- attribute to be encodedattributeValueElementName- the element name to createvalue- value to encodedwithType- whether to include xsi:type- Returns:
- the attribute value element or null if the given value was null or empty
-
encodeByteArrayValue
@Nullable public static XMLObject encodeByteArrayValue(@Nonnull IdPAttribute attribute, @Nonnull QName attributeValueElementName, @Nullable byte[] value, boolean withType) throws EncodingException Base64 encodes abyte[]into a SAML attribute value element.- Parameters:
attribute- attribute to be encodedattributeValueElementName- the element name to createvalue- value to encodedwithType- whether to include xsi:type- Returns:
- the attribute value element or null if the given value was null or empty
- Throws:
EncodingException- if the byte array can not be base64 encoded.
-
encodeXMLObjectValue
@Nullable public static XMLObject encodeXMLObjectValue(@Nonnull IdPAttribute attribute, @Nonnull QName attributeValueElementName, @Nullable XMLObject value) - Parameters:
attribute- attribute to be encodedattributeValueElementName- the SAML 1 or SAML 1 attribute namevalue- value to encoded- Returns:
- the attribute value element or null if the given value was null or empty
-
encodeScopedStringValueAttribute
@Nullable public static XMLObject encodeScopedStringValueAttribute(@Nonnull IdPAttribute attribute, @Nonnull QName attributeValueElementName, @Nullable ScopedStringAttributeValue value, @Nonnull @NotEmpty String scopeAttributeName, boolean withType) Encode aScopedStringAttributeValuevalue in to an SAML attribute value element using the (older Shibboleth) sytnax where the scope is inside an XML attribute.- Parameters:
attribute- attribute to be encodedattributeValueElementName- the element name to createvalue- value to encodedscopeAttributeName- the name that the attribute will be givenwithType- whether to include xsi:type- Returns:
- the attribute value element or null if the given value was null or empty
-
encodeScopedStringValueInline
@Nullable public static XMLObject encodeScopedStringValueInline(@Nonnull IdPAttribute attribute, @Nonnull QName attributeValueElementName, @Nullable ScopedStringAttributeValue value, @Nonnull String scopeDelimiter, boolean withType) Encode aScopedStringAttributeValuevalue into a SAML attribute value element using the "inline" syntax where the scope and value are combined into a string.- Parameters:
attribute- attribute to be encodedattributeValueElementName- the element name to createvalue- value to encodedscopeDelimiter- the delimiter to put between the value and the scopewithType- whether to include xsi:type- Returns:
- the attribute value element or null if the given value was null or empty
-
encodeDateTimeValue
@Nullable public static XMLObject encodeDateTimeValue(@Nonnull IdPAttribute attribute, @Nonnull QName attributeValueElementName, @Nullable Instant value, boolean withType) Encodes a date/time value into a SAML attribute value element.- Parameters:
attribute- attribute to be encodedattributeValueElementName- the element name to createvalue- value to encodedwithType- whether to include xsi:type- Returns:
- the attribute value element or null if the given value was null or empty
- Since:
- 4.3.0
-