We use an Azure AD B2C tenant as our Open ID Connect identity provider in a sandbox environment.
- From the Azure Portal (primary tenant), select
Create a resource
- Search for and select
Azure Active Directory B2C
- Click
Create
- Click
Create a new Azure AD B2C Tenant
- Fill in tenant naming details and click
Create
- Click
- From the top navigation bar, open the
Directory + subscription
pane and select the newly created tenant - From within the B2C tenant, search for and select
Azure AD B2C
- Under
Policies
, select theUser flows
blade- Click
New user flow
- Select
Sign in
and clickCreate
- Enter a name for the flow (e.g., "B2C-1_SI")
- Select
Email signin
underLocal accounts
- Under
Application claims
, select:Display name
Identity provider
User's Object ID
- Click
Create
- Click
- From within the B2C tenant, search for and select
Azure AD B2C
- Open the
App registrations
blade- Click
New registration
- Enter the name to match that of the application object in the main tenant
- Under
Supported account types
, select the third option (“any identity provider”) - Set the redirect URI to the base URI of the application, suffixed with
/.auth/login/aad/callback
- Click
Register
- Click
- From within the B2C tenant, search for and select
Azure AD B2C
- Open the
Users
blade- Click
New user
- Select
Invite user
- Enter the email address of the user to invite
- Click
Invite
- Click
- Once the user has accepted the invitation:
- Return to the
Users
blade - Click on the new user
- Click
Edit
- In the
Profile
blade, underUser type
, selectMember
- In the
Assigned roles
blade, clickAdd assignments
- Search for and check
Global administrator
, clickAdd
- Return to the
- From within the B2C tenant, search for and select
Azure AD B2C
- Open the
Users
blade- Click
New user
- Select
Create Azure AD B2C user
- Under
Sign in method
, selectEmail
- Enter the email address of the new user
- NOTE: if this user already has an administrative account with the same email address, some email providers allow for aliases
- Set a temporary password for the new user
- Click
Create
- Open the profile editing user flow and sign in as the new user. Under email, enter the same email address that was used for sign in and click continue.
- You should be redirected to jwt.ms where, under
Decoded Token
, you should see a claim with a type ofextension_EmailAddress
.
- You should be redirected to jwt.ms where, under
- Click
- From within the B2C tenant, search for and select
Azure AD B2C
- Open the
User flows
blade- From the list of user flows, select
B2C_1_pe
(pe
in this case stands for profile edit) - Click
Run user flow
- Under
Application
, select either the dashboard or querytool - Under
Reply URL
, selecthttps://jwt.ms
- Click
Run user flow
- The profile editor will open in a new tab. Once you sign in, you will be able to update the attributes for the user, and the associated claims will reflect those updates on the next sign in.
- From the list of user flows, select
- From within the B2C tenant, search for and select
Azure AD B2C
- Open the
User attributes
blade- Click
Add
- Enter the name and data type of the attribute, and click
Create
- Click
- Click the
User flows
blade- Select
B2C_1_si
(si
in this case stands for sign in) - Click
Application claims
- Find the attribute you just added in the list and check the box next to it
- Click save
- Select
- Repeat step 3 for the
B2C_1_pe
user flow - Follow the instructions for updating user attribute values