skip to content
Alvin Lucillo

SAML Assertion E-mail

/ 1 min read

If you’re expecting a event.user.email from Okta’s SAML Assertion in Auth0 action script, you need to set up the attribute statements in Okta. This is what the SAML assertion looks like. Notice that there’s email attribute.

<saml2:AttributeStatement>
        <saml2:Attribute Name="email" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
            <saml2:AttributeValue
                xmlns:xs="http://www.w3.org/2001/XMLSchema"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">hello@gmail.com
            </saml2:AttributeValue>
        </saml2:Attribute>
    </saml2:AttributeStatement>

To set the attribute, go to your app in Okta, and under General, click edit on the SAML Settings box. Head straight to step 2 (Configura SAML). On the Attribute Statements enter email as the name and user.email as the value.