Use Transformation Engine to send Base64 Encoded Claims in SAML

Follow
    Applies to:
  • SecureAuth Identity Platform
  • Legacy SecureAuth IdP
Deployment model:
  • Hybrid
  • On Premises
  • Version Affected:  Verified with SecureAuth IdP version 9.2, 9.3, 19.07, 19.07.01

    Description:

    You want to send claims in "Base64 Encoded" to application using SAML. Even after selecting "Base64 Encoded" in the Post Authentication tab under SAML attributes, IdP sending them in Plain text. We can use Transformation Engine to achieve it.

    Cause:  

    It works if you use Ws-Fed Identity protocol but for SAML you need to manipulate the data using Transformation Engine.

     

    Resolution:  

    Enable Transformation engine in Post Authentication and use the below code.


    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:user="urn:my-scripts">
    <msxsl:script language="C#" implements-prefix="user">
    <msxsl:using namespace="System.Globalization"/>
    <![CDATA[
    public string b64(string v)
    {
    var plainTextBytes = System.Text.Encoding.UTF8.GetBytes(v);
    return System.Convert.ToBase64String(plainTextBytes);
    }
    ]]>
    </msxsl:script>
    <xsl:template match="/">
    <user>
    <AuxID6>
    <xsl:value-of select="user:b64(user/AuxID6)"/>
    </AuxID6>
    </user>
    </xsl:template>
    </xsl:stylesheet>

     

    You can add additional attributes in the above code Under <user> section.

    Special Considerations:

    Templates include XSLT and .NET functions to manipulate data, append static data, and enable conditional circumstances are provided in Transformation engine guide. The above code can also be used with them.
    https://docs.secureauth.com/display/91docs/Transformation+Engine+Guide 

     

     

    SecureAuth Knowledge Base Articles provide information based on specific use cases and may not apply to all appliances or configurations. Be advised that these instructions could cause harm to the environment if not followed correctly or if they do not apply to the current use case.

    Customers are responsible for their own due diligence prior to utilizing this information and agree that SecureAuth is not liable for any issues caused by misconfiguration directly or indirectly related to SecureAuth products.

    0 out of 0 found this helpful

    Comments

    0 comments

    Please sign in to leave a comment.