Error: "Profile did not include an user_id. Make sure your user_id mapping points to the correct property"

Problem statement

We are setting up a new SAML connection and get the error “Profile did not include an user_id. Make sure your user_id mapping points to the correct property”.

Troubleshooting

The connection has custom mapping to set the user_id to the claim, named “urn:oid:0.9.XXXX.XXXXXXX.XXX.X.X”.
SAML Response shows a claim with this name sent to Auth0.

Cause

On the main settings page for the connection, we have also configured the User ID Attribute to “email”.

This value takes precedence over the mapping configured on the Mapping tab for the user_id, therefore it overrides the “urn:oid…” value.

The SAML response has no claim named “email”, so they are not having any claim assigned to user_id and are receiving the error “Profile did not include an user_id. Make sure your user_id mapping points to the correct property.”

Solution

Since you have already correctly set the mapping for the user_id on the Mapping tab for the connection, you can delete this “email” value from the User ID Attribute field for the connection, and then the mapping will update to use the “oid:urn…” claim instead.