Search Results :

×

Magento Azure AD (Microsoft Entra ID) Single Sign-On (SSO) | SSO into Magento using Azure AD Credentials

Integration of Azure AD (Microsoft Entra ID) Login (Azure Active Directory OAuth Single Sign-On) with Magento using OAuth 2.0 Protocol. The Magento OAuth / OpenID Connect Single Sign-On (SSO) extension allows the users to log in to the Magento store using the Azure AD Credentials (Azure AD Single Sign on). Magento 2 SSO using Azure AD as IDP. Advanced Single Sign-On features such as user profile Attribute Mapping, Role Mapping, and so on are supported. In this guide, we'll go over how to set up SSO between Magento and Azure AD. At the end of this article, users should be able to login with Azure AD in Magento.

Click here to read more about the Magento OAuth Single Sign-On (OAuth & OpenID Connect Client) extensions extra features.

  • Purchase the miniOrange Magento OAuth Single Sign-On (SSO) extension from Magento Marketplace (Adobe Commerce Marketplace).
  • Go to My profile -> My Purchases
  • Please ensure you are using correct access keys (My Profile - Access Keys)
  • Paste the access keys in your auth.json file inside your project
  • Use the below command to add the extension to your project.
    "composer require {module_name}:{version}"
  • You can see the module name and list of versions in the selector below the extension module name.
  • Run the following commands on command prompt to enable the extension.
  • php bin/magento setup:upgrade
  • Download the miniOrange Magento OAuth Single Sign-On (SSO) extension.
  • Unzip all contents of the zip inside the MiniOrange/IDPSaml directory.
  • {Root Directory of Magento} app code MiniOrange OAuth
  • Run the following commands on command prompt to enable the extension
  • php bin/magento setup:upgrade

  • Sign in to Microsoft Entra ID (Azure AD) portal.
  • Select Microsoft Entra ID (Azure AD).
  • Magento Azure AD SSO - Login | Magento 2 Azure AD SSO
  • In the left-hand navigation panel, click the App registrations service, and click New registration.
  • Magento Azure AD SSO - Login | Magento 2 Azure AD SSO - App-Registration
  • 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 (for authenticating user with user flows).
    • In the Redirect URI section, select the Web application and enter the Callback URL from the miniOrange Magento OAuth Client plugin (OAuth Providers Tab) and save it under the Redirect URL textbox.
    • Magento Azure AD SSO - Login | Magento 2 Azure AD SSO - Create
    • Click on the Register button to create your application.
    • Magento Azure AD SSO - Login | Magento 2 Azure AD SSO - Create
  • Microsoft Entra ID (Azure AD) assigns a unique Application ID to your application. The Application ID is your Client ID and the Directory ID is your Tenant ID, keep these values handy as you will need them to configure the miniOrange Magento SSO OAuth Client extension.
  • Magento Azure AD SSO - Login | Magento 2 Azure AD SSO - Overview
  • Go to Certificates and Secrets from the left navigaton panel and click on New Client Secret. Enter description and expiration time and click on ADD option.
  • Magento Azure AD SSO - Login | Magento 2 Azure AD SSO - secret-Key
  • Copy the secret key "value" and keep the value handy it will be required later to configure Client Secret under the miniOrange Magento SSO OAuth Client extension.
  • Magento Azure AD SSO - Login | Magento 2 Azure AD SSO - Secret-Key-2

    In conclusion , by successfully configuring Azure AD as OAuth Provider, you have enabled Magento Azure AD SSO Login and authorization for your end users into Magento.

  • After successfully configuring OAuth Provider, go to OAuth Providers tab and click on Add Provider button.
  • Magento Azure AD SSO - Login | Magento 2 Azure AD SSO - Settings
  • Now, Enter the OAuth Provider Name, Client ID, Client Secret, Scope and provided endpoints.
  • Please refer the Endpoints table provided below to authorize Single Sign-On (SSO) with Azure AD single-tenant environment to your Magento site.
    • Scope: openid
      Authorize Endpoint: https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/authorize
      Access Token Endpoint: https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/token
      Get User Info Endpoint: https://login.windows.net/<tenant-id>/openid/userinfo
      Custom redirect URL after logout:[optional] https://login.microsoftonline.com/<tenant-id>/oauth2/logout?post_logout_redirect_uri=<your URL>
  • Please refer the Scope and endpoints table provided below to authorize Single Sign-On (SSO) with any Azure AD tenant environment to your Magento site.
    • Scope: openid
      Authorize Endpoint: https://login.microsoftonline.com/common/oauth2/v2.0/authorize
      Access Token Endpoint: https://login.microsoftonline.com/common/oauth2/v2.0/token
      Get User Info Endpoint: https://login.windows.net/common/openid/userinfo
      Custom redirect URL after logout:[optional] https://login.microsoftonline.com/common/oauth2/logout?post_logout_redirect_uri=<your URL>
  • Click on the Save button to save the settings.
  • Click on the Test Configuration button.
  • Magento Azure AD SSO - Login | Magento 2 Azure AD SSO - Save settings
  • 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.
  • Magento Azure AD SSO - Login | Magento 2 Azure AD SSO - Test Config
    Note and Contact Us - SSO between two WordPress sites

    Note: In the Enterprise Version of the extension you can setup multiple providers. To setup a different provider click on the Add Provider button and setup your required provider. You can find the setup guides of all the providers from here.

    • Navigate to Multisite Settings tab. Here you can all the subsites under your Magento Installation where you wish to enable the SSO. You can check the checkbox against all the subsites and click on save.
    • You would also see the Callback URL for each subsite which you can use to setup the required OAuth Provider.
    • Magento Azure AD SSO - Login | Magento 2 Azure AD SSO - Multisite Settings
    • Navigate to Sign-in Settings tab and Choose the OAuth Provider from the dropdown menu to proceed with the configuration.
    • Here you find the option the enable the login link on Admin*/Customer Login Page (*Admin SSO is available in the premium versions)
    • Magento Azure AD SSO - Login | Magento 2 Azure AD SSO - Admin Customer Link
    • You can automatically create Admin and Customer users during SSO if they don't already exist. Simply enable the corresponding checkbox to activate.
    • Magento Azure AD SSO - Login | Magento 2 Azure AD SSO - Auto Create Users
    • 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.
    • Magento Azure AD SSO - Login | Magento 2 Azure AD SSO - Redirect users
    • If you want to initate SSO from any page you can also use the SSO link provided in the extension.
    • Magento Azure AD SSO - Login | Magento 2 Azure AD SSO - SSO Link
  • Go to customer login page and you will see the SSO button on your frontend. Click on the button and test the SSO.
Magento 2 OAuth SSO customer SSO

  • You will be sucessfully logged in into Magento.
magento SSO magento 2 OAuth client SSO Admin SSO

  • 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.
Magento 2 Admin SSO login button

  • After sucessfully logged into magento as admin you will be redirect to magento backend dashboard.
Magento 2 Admin SSO admin dashboard

  • Navigate to Sign-in Settings tab. Here you find the option the enable the SSO for your Headless Magento Store.
  • Paste your Frontend Post URL in the given field. You should enter your frontend store URL here.
Magento Azure AD SSO - Login | Magento 2 Azure AD SSO - Headless SSO

  • Attributes are user details that are stored in your Identity Provider.
  • Attribute Mapping helps you to get user attributes from your Identity Provider (IdP) and map them to Magento user attributes like firstname, lastname etc.
  • While auto registering the users in your Magento site these attributes will automatically get mapped to your Magento user details.
  • Only NameID can be mapped to Magento's Email and Username characteristics with the free plugin. Multiple user attributes from the IdP, on the other hand, can be mapped to Magento attributes in the premium version of the plugin. You can map custom attributes that you've added to your IdP in addition to the default attributes.
  • When a user performs SSO, the NameID value sent by the IdP will get mapped to the email and the username of the Magento user.
Magento Azure AD SSO - Login | Magento 2 Azure AD SSO - attribute mapping

    Username: Name of the username attribute from IdP (Keep NameID by default)
    Email: Name of the email attribute from IdP (Keep NameID by default)
    Group/Role: Name of the Role attribute from Identity Provider (IdP)
  • You can check the Test Configuration Results under Service Provider Setup tab to get a better idea of which values to map here.
  • In the Enter Attribute Name field enter the Attribute Name you wish to map against the attribute you are receiving from your Identity Provider.
  • Click on Add button
  • Now, Enter the attribute name your are receiving from your Identity Provider in the provided field.
  • 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.
Magento Azure AD SSO - Login | Magento 2 Azure AD SSO - custom attribute mapping

ADFS_sso ×
Hello there!

Need Help? We are right here!

support