How to use the Transformation Engine to correctly Base64 encode the ObjectGUID

    Applies to:
  • Legacy SecureAuth IdP
Deployment model:
  • On Premises
  • Version Affected:  All


    How to use the Transformation Engine to correctly Base64 encode the ObjectGUID



    The standard B64 example code for the transformation engine does not work correctly on ObjectGUID. Use this method instead. 



    1. Open the Web Admin console and map an AuxID to ObjectGUID. The example code below assumes that you have mapped AuxID10 to ObjectGuid on the Data tab.

    2. On the Post Auth tab, click the Transformation Engine

    3. Enable the Transformation Engine and use the following code


    <xsl:stylesheet version="1.0" xmlns:xsl="" xmlns:msxsl="urn:schemas-microsoft-com:xslt" 
    <msxsl:script language="C#" implements-prefix="user"> 
    <msxsl:using namespace="System.Globalization"/> 
    public string LowerCase(string v) 

    return v.ToLower(); 

    public string UpperCase(string v) 

    return v.ToUpper(); 

    public string CamelWord(string v) 

    TextInfo textinfo = new CultureInfo("en-US",false).TextInfo; 
    return textinfo.ToTitleCase(v); 

    public string b64(string v)
    Guid newGuid = new System.Guid(v);
    Byte[] bytes = newGuid.ToByteArray();
    var encodedGuid = Convert.ToBase64String(bytes);
    return encodedGuid ;

    <xsl:template match="/"> 
    <xsl:value-of select="user/UserID" /> 
    <xsl:value-of select="user/Email1" /> 
    <xsl:value-of select="user/Email2" /> 
    <xsl:value-of select="user/Email3" /> 
    <xsl:value-of select="user/Email4" /> 
    <xsl:value-of select="user/AuxID1"/> 
    <xsl:value-of select="user/AuxID2"/> 
    <xsl:value-of select="user/AuxID3"/> 
    <xsl:value-of select="user/AuxID4"/> 
    <xsl:value-of select="user/AuxID5"/> 
    <xsl:value-of select="user/AuxID6"/> 
    <xsl:value-of select="user/AuxID7"/> 
    <xsl:value-of select="user/AuxID8"/> 
    <xsl:value-of select="user/AuxID9"/> 
    <xsl:value-of select="user:b64(user/AuxID10)"/> 
    <xsl:value-of select="user/FirstName" /> 
    <xsl:value-of select="user/LastName" /> 
    <xsl:value-of select="user/Phone1"/> 
    <xsl:value-of select="user/Phone2"/> 
    <xsl:value-of select="user/Phone3"/> 
    <xsl:value-of select="user/Phone4"/> 


    If implementing this change on multiple servers, note that this does not get synced over via FileSync. You will either need to manually change this on each server or bring over the usersprofiledata.xslt file from the server where this change was implemented.

    This is located in D:\Secureauth\SecureAuthxx\PostAuthData


    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.