Use Transformation Engine to send Base64 Encoded Claims in SAML

    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


    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.


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



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

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


    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. 



    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



    Please sign in to leave a comment.