Last active
February 9, 2023 10:37
-
-
Save woloski/8162612 to your computer and use it in GitHub Desktop.
Salesforce Auth0 rule. This is the default mapping Auth0 will use for Salesforce. You can create a new Rule and change this with whatever you want.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function (user, context, callback) { | |
// | |
// this rule can be used if you have chosen to use Username as the way to identify a user in Salesforce. Notice that we are mapping the email to the nameidentifier. | |
// | |
if (context.clientName === 'Salesforce') { | |
context.samlConfiguration.mappings = { | |
'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier': 'email', | |
'User.Username': 'email', | |
'User.Email': 'email', | |
'User.FirstName': 'given_name', | |
'User.ProfileId': 'salesforce_profile_id', | |
'User.LastName': 'family_name' | |
} | |
} | |
callback(null, user, context) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function (user, context, callback) { | |
if (context.clientName === 'Salesforce') { | |
context.samlConfiguration.mappings = { | |
'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier': 'user_id', | |
'User.Username': 'email', | |
'User.Email': 'email', | |
'User.FirstName': 'given_name', | |
'User.ProfileId': 'salesforce_profile_id', | |
'User.LastName': 'family_name' | |
} | |
} | |
callback(null, user, context) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment