I want to show different screens based on which connected app is used to login to Salesforce. Can the login flow somehow know which connected app is used?
There are multiple Login Flow variables we can leverage, but none of those contain the connected app.
None of the following seem useful for this scenario (source):
- LoginFlow_LoginType – This variable allows you to designate a user type for Flow/Org.
- LoginFlow_IpAddress – This variable acts as a user’s IP address. Through this variable, you have the power to delegate an IP address
for a user, profile and other user-related fields.- LoginFlow_UserAgent – This variable stands as the user’s browser string. It also allows you to keep users from using Internet
Explorer to log into your Org.- LoginFlow_Platform – This variable shows you what kind of system (i.e. Mac OSX) your users are logging in from.
- LoginFlow_Application – Similar to the above variable; however, it shows what kind of device your users log in from (i.e. iPhone,
tablet, desktop, etc.) so that you’ll know what finish location to
relocate them to.- LoginFlow_Community – This variable shows what Community your user is currently in, if applicable. LoginFlow_SessionLevel – This
variable is responsible for security and either works in high or
standard assurance.- LoginFlow_UserId – This variable functions to display character IDs (up to 18 characters long) and also allows you to Lookup your
user(s) and search the system to find similar fields.
Answer
You may be in luck. There’s something call the ExperienceID or expid
that potentially could be used to do what you want to achieve. Its primary purpose is to be able to customize the “branding experience” for customers depending on where they are sent to your community from.
You can learn more about it by reading this link to the Salesforce External Identity Implementation Guide and also by reading Change Your Users’ Login Experience with Dynamic Branding from the Winter 18 Release Notes. If you associate each connected app with a different expid
, it would seem to me that you could use it accomplish what you want with your Connected Apps by assigning each app a unique expid.
The ExperienceID can then be used to extend an endpoint using one of two different strategies as shown below.
Extend the following endpoints with expid_value.
- community-url/services/oauth2/authorize/expid_value
- community-url/idp/endpoint/HttpPost/expid_value
- community-url/idp/endpoint/HttpRedirect/expid_value
Extend the following endpoints with expid={value}.
- community-url_login_page?expid={value}
- community-url/CommunitiesSelfReg?expid={value}
- community-url/.well-known/auth-configuration?expid={value}
Pass in a different expid value to the self-registration page to deliver a different registration flow for each brand.
The experience ID value is captured in a cookie rather than in the URL. For example, if the expid_value is set to Customers, an associated cookie has the expid_Customers value.
Attribution
Source : Link , Question Author : Folkert , Answer Author : crmprogdev