Configure the Magento OAuth & OpenID Connect Single Sign-On (SSO) extension with Azure B2C Single Sign-On (SSO). Use Microsoft Azure B2C as an OAuth and OpenID Connect provider to provide safe login into Magento. With Azure B2C Single Sign-On (SSO), your users may log in and access your Magento site by authenticating with their Azure B2C identity provider. You can also use various IDPs, such as Azure AD, Office 365, and other bespoke providers, to configure the extension. It has powerful Single Sign-On (SSO) features like user profile attribute mapping and role mapping, among others. We'll go over how to set up Single Sign-On (SSO) for user authentication between Magento and Azure B2C in this guide.
To know more about other features we provide in Magento OAuth Single Sign-On ( OAuth & OpenID Connect Client ) extension, you can click here.
Go to Home and in the Azure services, select Azure AD B2C.
Please make sure you are in the Azure AD B2C directory with an active subscription and if not, you can switch to the correct directory.
In the Essentials tab, you will find the Azure B2C domain name, keep it handy, you will need it later for configuring the Azure B2C tenant name under Magento OAuth SSO extension.
What is Tenant Name? You will need to copy the highlighted domain name portion only as shown in the below screenshot in order to configure the tenant name in the Magento OAuth SSO extension. Eg. If your domain name is 'exampledomain.onmicrosoft.com', then your tenant name will be 'exampledomain'.
Now, click on App registrations and then click on the New registration option to create a new Azure b2c application.
Configure the following options to create a new application.
Enter a name for your application under the Name text field.
In supported account types, select 3rd option ‘Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox)’
In the Redirect URI section, select the Web application and enter the Callback URL from the miniOrange OAuth Client plugin (Configure OAuth tab) and save it under the Redirect URL textbox.
Click on the Register button to create your application.
After successful application creation, you will be redirected to the newly created application’s overview page. If not, you can go to the app registrations and search the name of your application and you will find your application in the list.
Copy your Application ID and keep it handy, you will need it later for configuring the Client ID under Magento OAuth SSO extension.
Now, click on Certificates and secrets and then click on New client secret to generate a client secret. Enter a description and click on the Add button.
Copy the secret value from certificates & secrets page and keep it handy, you will need it later for configuring the Client Secret under Magento OAuth Client extension.
Step 1.1: Add Users in your B2C application
In home page, go to the Users tab in the left corner
Click on New user in the users page
Select Create Azure AD B2C user. Then, scroll down and click on Email from sign in method and set your password and click create to save the user details to perform test configuration.
Step 1.2: How to create & add Azure B2C Policy
Go to User Flows tab and then click on New user flow.
Select a User flow type Sign up and Sign in then click on Create button.
Fill all the information e.g. Name, Identity providers, etc. then click on Create button.
Copy the Policy name this value whenever you need to enter Azure B2C Policy in miniOrange OAuth Client extension.
Step 1.3: Add user claims to your application
Go to user flows under policies in the left corner. Select the configured policy.
Select Application claims in settings
Select the desired attributes to be displayed on the test configuration and save it.
Step 1.4: Configure ID-Token Claims in Azure B2C [Premium]
Go to your application in Azure Active Directory and select Token configuration from the left menu.
Click on Add optional claim and then select ID from the right section.
Now choose all the attributes you want to fetch while SSO (e.g family_name, given_name, etc) and click on Add button.
You might see a popup to Turn on the Microsoft Graph profile permission (required for claims to appear in token), enable it, and click on Add button.
You've successfully configured Azure AD (Active Directory) B2C as an OAuth Provider for Magento user integration using Azure AD Single Sign-On (SSO)
2. Configuring Magento 2 as OAuth Client
After successfully configuring OAuth Provider, go to OAuth Provider tab and configure OAuth Provider Name, Client ID, Client Secret, Scope and provided endpoints.
Please refer below Endpoints to configure the OAuth Client
You will see all the values returned by your OAuth Provider to Magento in a table. If you don't see value for First Name, Last Name, Email or Username, make the required settings in your OAuth Provider to return this information.
3. Sign-In Settings
Navigate to Sign-in Settings tab. Here you find the option the enable the login link on Admin*/Customer Login Page (*Admin SSO is available in the premium versions)
If you want to initate SSO from any page you can also use the SSO link provided in the extension.
The Premium extension also provides you the the feature to auto redirect your user to the IdP Login Page if the user is not already logged in.
Go to customer login page and you will see the SSO button on your frontend. Click on the button and test the SSO.
You will be sucessfully logged in into Magento.
Visit your admin login page and you will see the SSO button on your admin page. Click on the button to initate SSO as an admin.
After sucessfully logged into magento as admin you will be redirect to magento backend dashboard.
Attribute / Custom Attribute Mapping (Optional). *This is Premium feature.
1.1: Attribute Mapping (Optional). *This is Premium feature.
You can map attributes in the Attribute Mapping tab. Only username and email are allowed to be mapped in free version of the extension. However, in the premium version of the extension, you can map various attributes coming from your OAuth Provider to the attributes present in your Magento site.
1.2: Custom Attribute Mapping (Optional). *This is Premium feature.
Enter your table name in Table field.
Enter attribute name as your column name (in the respective table)
Click on Add button for adding custom magento attribute and map the respective field with the attribute receiving from your identity provider
Click on save button for saving the configuration.
You can also delete the configuration by entering the name in attribute name field and then click on delete button.
Role Mapping (Optional). *This is Premium feature.
You can specify a default role in the free extension that will be allocated to all non-admin users when they conduct SSO.
Go to Attribute/Role mapping tab and navigate to Role Mapping section.
Select the Default Role and click on the Save button.
By configuring Azure AD B2C as an OAuth Provider and Magento as an OAuth Client using our Magento OAuth Client extension, you have successfully installed Magento Azure AD (Active Directory) B2C Single Sign-On (SSO). Within minutes, you'll be able to provide safe access to your Magento site utilising Azure AD B2C login credentials thanks to this solution.p>
If you dont hear from us within 24 hours, please feel free to send a follow up email to email@example.com
This privacy statement applies to miniorange websites describing how we handle the personal
When you visit any website, it may store or retrieve the information on your browser, mostly in the
form of the cookies. This information might be about you, your preferences or your device and is
mostly used to make the site work as you expect it to. The information does not directly identify
you, but it can give you a more personalized web experience.
Click on the category headings to check how we handle the cookies.
Strictly Necessary Cookies
Necessary cookies help make a website fully usable by enabling the basic functions like site
navigation, logging in, filling forms, etc. The cookies used for the functionality do not store any
personal identifiable information. However, some parts of the website will not work properly without
These cookies only collect aggregated information about the traffic of the website including -
visitors, sources, page clicks and views, etc. This allows us to know more about our most and least
popular pages along with users' interaction on the actionable elements and hence letting us improve
the performance of our website as well as our services.