This article provides guidelines for Just-in-Time (JIT) provisioning with SAML Single Sign-On (SSO) in Salesforce. JIT provisioning automatically creates or updates Salesforce user records when a user authenticates via SAML SSO for the first time.
Note: This article applies to standard JIT Provisioning for SAML SSO. For custom configurations where Apex code implements the SamlJitHandler Interface, Step 1 below applies by default and Steps 2–7 can be handled by the Apex code.
When a user attempts to log in via SAML SSO, Salesforce follows these steps sequentially:
12345) to the FederationIdentifier field of an existing user record.User.Contact) or email (Contact.Email). Note: Contact.Email and Contact.LastName are both required when User.Contact is not specified. Matching is based on Contact.Email when both properties exist.Contact.Account or Account.AccountNumber. Note: Account.AccountNumber and Account.Name are both required when Contact.Account is not specified. Matching is based on Account.AccountNumber when both exist.
To configure JIT provisioning for SAML SSO in Salesforce, ensure your SAML assertion includes the correct attributes for user, contact, and account matching as described in the seven-step process above.
Minimum Required Attributes by Scenario:
Scenario A — Create portal users with a known Account ID:
Include Contact.Account (the Account ID), Contact.LastName, Contact.Email, User.ProfileId, User.PortalRole, User.Username, User.Email, and User.LastName in your SAML assertion. This creates new portal users and contacts linked to a specific hardcoded Account.
Scenario B — Create portal users with Account lookup by Name and Number:
Include Account.AccountNumber, Account.Name, Account.Owner (owner ID required to create a new account), Contact.LastName, Contact.Email, User.ProfileId, User.PortalRole, User.Username, User.Email, and User.LastName. This allows Salesforce to match or create the Account by number and name.
Scenario C — Create portal users without Account creation:
Include Contact.LastName, Contact.Email, User.ProfileId, User.PortalRole, User.Username, User.Email, and User.LastName. Omit all Account attributes. If no matching account or contact record exists, no new records are inserted.
In all scenarios, you can include additional attributes that correspond to standard fields on the User, Contact, and Account records beyond the minimum required set.
000385744

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.