Azure AD B2C is used as the identity provider for federated authentication, providing a single sign-on experience in Dynamics 365 Portals and Connect 365. This documentation walks through the administrative steps to provision and configure an Azure AD B2C tenant, and configure Dynamics 365 Portals and Connect 365 to use B2C as their common identity provider.
This section covers creating a new Azure AD B2C tenant in the Azure Portal.
B2C tenant domain name | e.g. contoso.onmicrosoft.com |
---|
This section covers the creation and configuration of an application registration to enable single sign-on across the Dynamics 365 Portal and the Connect 365 web application.
Name | e.g. Dynamics 365 Portal |
---|---|
Include web app | Yes |
Allow implicit flow | Yes |
Reply URL - Portal | e.g. https://contoso.microsoftcrmportals.com/signin-b2c |
Reply URL - Connect 365 |
e.g. When a site has multiple languages, use the URL of the primary language. e.g. |
App ID URI | e.g. portal |
B2C Application Reply URL - Portal | e.g. https://contoso.microsoftcrmportals.com/signin-b2c |
---|---|
B2C Application Reply URL - Connect 365 |
e.g. When a site has multiple languages, use the URL of the primary language. e.g. |
B2C Application App ID URI | e.g. https://contoso.onmicrosoft.com/portal |
B2C Application ID | e.g. 8075a5ce-2538-4bd4-b61d-1e9349ad923e |
---|
Scope | all |
Description | all items |
Record the scope value for future reference:
B2C Application Scope | e.g. all |
API | Dynamics 365 Portal |
Select Scopes | all items (all) |
Additional social providers aside from local accounts may be added if desired. Not all providers are currently supported, please refer to the following categories of support:
Supported providers:
Unsupported providers (due to technical limitations):
Untested providers:
B2C Sign-up or Sign-in Policy Name | e.g. B2C_1_Default |
Access & ID token lifetimes |
The duration (minutes) tokens remain valid. Choose a value that will be the same or longer than the portal session duration defined in the site setting Authentication/ApplicationCookie/ExpireTimeSpan to ensure users can access Connect 365 functionality for the entire duration of their portal sign-in session. For example, a value of |
---|---|
Issuer (iss) claim | Choose the claim that begins with https://login.microsoftonline.com/tfp/ |
Claim representing policy ID | tfp |
Single sign-on configuration | Tenant |
Click OK, then save.
Please ensure the login.microsoftonline.com
option is selected prior to clicking the hyperlink. Support for the b2clogin.com domain is in the process of being added in v1.4.
B2C Sign-up / Sign-in policy issuer | e.g. https://login.microsoftonline.com/tfp/30da4020-68e4-4530-ac7a-a0f8aecb0cc2/b2c_1_default/v2.0/ |
---|
To setup Facebook as an identity provider, refer to the Microsoft documentation Set up sign-up and sign-in with a Facebook account using Azure Active Directory B2C. Supplementary information to configure the application is as follows:
v1.3+
When using the login.microsoftonline.com
domain, use the following Valid OAuth Redirect URIs values when configuring the Facebook app settings:
https://login.microsoftonline.com/te/30da4020-68e4-4530-ac7a-a0f8aecb0cc2/oauth2/authresp
https://login.microsoftonline.com/te/contoso.onmicrosoft.com/oauth2/authresp
Substitute the values between /te/
and /oauth/
with the Tenant ID and domain of the B2C tenant in the respective URIs.
v1.4+
When using the b2clogin.com
domain, use the following Valid OAuth Redirect URIs values when configuring the Facebook app settings:
Create site settings with the following values:
Site Settings | Value |
---|---|
Authentication/OpenIdConnect/B2C/Authority |
Enter the previously recorded value B2C Sign-up / Sign-in policy issuer. e.g. |
Authentication/OpenIdConnect/B2C/Caption | The login button text in the portal e.g. Azure AD B2C |
Authentication/OpenIdConnect/B2C/ClientId |
Enter the previously recorded value B2C Application ID. e.g. |
Authentication/OpenIdConnect/B2C/ExternalLogoutEnabled |
This setting is optional but is highly recommended to set it to |
Authentication/OpenIdConnect/B2C/RedirectUri |
Enter the previously recorded value B2C Application Reply URL - Portal. e.g. |
Authentication/OpenIdConnect/B2C/RegistrationClaimsMapping |
Enter a list of values to map the claims to fields on the contact record. For example, for the given name and surname claims to be stored in the firstname and lastname fields on the contact record e.g. Reference: |
Authentication/ApplicationCookie/ExpireTimeSpan |
The duration users remain signed in to the portal after authenticating. Choose a value that will be the same or less than the B2C policy's Access & ID token lifetimes value to ensure users can access Connect 365 functionality for the entire duration of their portal sign-in session. e.g. a value of |
Authentication/ApplicationCookie/SlidingExpiration |
Note: the value false is used to prevent a portal sign-in session from extending beyond the duration of the B2C authentication session that is shared with Connect 365. |
Authentication/OpenIdConnect/B2C/AllowContactMappingWithEmail |
This setting is optional. When used, it will automatically associate signed-in users who have already verified their email address through B2C to an existing contact record with the same email address. Reference: true |
You must create the web page referenced in B2C Application Reply URL - Connect 365 above, with the following values:
Field | Value | Notes |
---|---|---|
Name | B2C Silent Sign-in |
This can be any name you prefer. |
Parent Page | Home |
This can be any value you prefer, but the final url of the page must match the value of B2C Application Reply URL - Connect 365 |
Partial URL | b2c-silent-signin |
This can be any value you prefer, but the final url of the page must match the value of B2C Application Reply URL - Connect 365 |
Page Template | Blank Page |
You can use any Page Template you prefer, but it is recommended to use as minimal a page template as possible. Users will never visually see this web page. |
Copy (HTML) | {% include 'Connect 365 - Authentication' %} |
This references the Web Template created in the next step. |
Dynamics 365 Portals supports multiple languages, and web pages have one or more localized content pages. The Liquid code needs to be entered into one of the localized content records associated to the web page:
You must create the web template referenced in your Web Page above, with the following values:
Field | Value |
---|---|
Name | Connect 365 - Authentication |
Source | Download as text |
This section covers creating settings that Connect 365 will use to reference Azure AD B2C for facilitating federated authentication.
Feature | Name | Type | Value |
---|---|---|---|
Azure AD B2C | Tenant Domain | Single Line of Text |
Enter the previously recorded value B2C tenant domain name. e.g. |
Azure AD B2C | Policy Issuer | Single Line of Text |
Enter the previously recorded value B2C Sign-up / Sign-in policy issuer. e.g. |
Azure AD B2C | Policy Name | Single Line of Text |
Enter the previously recorded value B2C Sign-up / Sign-in Policy Name. e.g. |
Azure AD B2C | Application ID | Single Line of Text |
Enter the previously recorded value B2C Application ID. e.g. |
Azure AD B2C | Application ID URI | Single Line of Text |
Enter the previously recorded value B2C Application App ID URI. e.g. |
Azure AD B2C | Application Scope | Single Line of Text |
Enter the previously recorded value B2C Application Scope. e.g. |
Azure AD B2C | Application Reply URL | Single Line of Text |
Enter the previously recorded value B2C Application Reply URL - Connect 365. e.g. When a site has multiple languages, use the URL of the primary language. e.g. |
The values once entered should appear very similar to the following example. Please carefully compare the entered settings to this example. The settings must be entered using the correct format and values for authentication to work.