Guide for Magento 2 Azure AD(Active Directory) Login

Using this Magento 2 Azure AD Login extension, the users having an account with Azure AD will be able to directly log in to the Magento 2 customer account using the Azure AD credentials at the Magento 2 website.

Azure AD (Azure Active Directory) is Microsoft’s cloud-based identity and access management service.

It is a directory and identity management service that provides a single sign-on (SSO) experience for users, allowing them to access multiple applications and services with a single set of login credentials.

  • Magento 2 login using Azure AD Idp.
  • Admin can enable or disable the functionality.
  • Set the redirect URL to be used on the AD side.
  • Plugin functionality will work according to the store view.

#Download Module

Firstly, you need to log in to Webkul Store, go to My Account>My Purchased Products section, verify and then download and extract the contents of this zip folder on the system.

#Upload Folder

Once the module zip is extracted, follow path src>app and then copy the app folder into the Magento 2 root directory on the server as shown below:

Searching for an experienced
Magento 2 Company ?
Read More


#3 Run Commands

You need to run the following commands:

  • composer require microsoft/microsoft-graph
  • php bin/magento setup:upgrade
  • php bin/magento setup:di:compile
  • php bin/magento setup:static-content:deploy
  • php bin/magento indexer:reindex
  • php bin/magento cache:flush

For translating the module language, navigate through src/app/code/Webkul/AzureAdLogin/i18n and edit the en_US.csv file. Thereafter, rename the CSV as “en_SA.csv” and translate all right side content after the comma in the Arabic language. After editing the CSV, save it.

Magento 2 Azure AD Login language translation

Now, upload it to the path src/app/code/Webkul/AzureAdLogin/i18n where the installation of Magento 2 is on the server. The module gets translated into the Arabic Language. It supports both RTL and LTR languages.

The user can edit the CSV like the image below.

Magento 2 Azure AD Login csv file

Microsoft Azure Account Creation

To create a Microsoft account, navigate to the registration page of the same.

Magento 2 Azure AD Login create Microsoft

Here, enter the email that will be used for account creation and tap the Next button. Now, enter your password and tap the Next button to create the Microsoft Azure account.

2

After login, you can see the dashboard of Microsoft Azure as shown in the image below.

3

After registering you can see the dashboard.

4

New App Creation Azure AD

After login into your Microsoft Azure AD account, tap on the App Registration service.

4

This brings up the section for App registrations. Tap on the New registration option.

1-1

After that, enter the name of the app and choose the Supported account types and tap the Register button after that.

1-2

Thereafter, you can see a pop-up Create application success message at the top right-hand side with app details.

1-3

Add Redirect URL

For adding the redirect URL tap on the “Add a Redirect URL” link in the image above and the below section appears.

1-4

After that, tap on the Add a platform option. This brings up the section to configure the platform. Here, choose Web.

1.png

Now, enter the URL redirect that you have configured in the magneto 2 extensions backend. The redirect URL will be your website URL with /azure/azure/Oauth in the end.

Example: https://example.com/azure/azure/Oauth

1-5

Generate Client Credentials for the App

For the same, tap on the “Add a certificate or secret link” as per the below snapshot.

image-57

After that, tap on the New client secret option as per the below snapshot.

1-6

Now, add the name of the client’s secret and tap the add button after that.

1-7

After tapping the Add button, the client secret will get generated.

Note: It will be available only once so copy it in a safe place for use later in the extensions configuration.

2-1

New User Account Creation

To reach the section for creating the user, first tap on the Users service as shown below in the snapshot.

4

After that, tap on the New user option.

new_user-1

Now, choose to create a user manually or send an invitation to a user for registration at Azure AD.

new_user-2

Create a new internal user in your organization

Enter the details for the new user and tap the create button after that.

create_user

After tapping on the Create button the user will be created and using the created Username and password the user can now log in to the Magento 2 Website using the credentials.

Invite an external user to collaborate with your organization

Tap the invite User option and enter the respective details and tap the Invite button after that.

create_user1

After that, the invited user gets the email to accept the invitation.

accept_invitation

After accepting the invitation, you can log in to the Azure Active Directory user dashboard.

enter_pwd

Tap the email code option and an OTP will be sent to that email address, enter that and tap Sign in.

enter-authentication-code

After that, accept the agreement.

invitations.microsoft.com_ConsentAndRedeem_lc2057screenshot

After that, the user can see the user dashboard of Azure Active Directory.

active-directory

Initial Configuration – Magento 2 Backend

After the successful installation of the Magento 2 Azure AD login extension, the admin will navigate through – Stores->Configuration->Webkul->Azure Login to configure the initial settings.

Magento 2 Azure AD Login configuration

Here the admin will –

  • Enable or disable the Login with Azure option for the storefront.
  • Enter the Application (client) ID that you got after creating an app at the Azure AD dashboard.
  • Enter the Client’s Secret key that you got after creating an app at the Azure AD dashboard.
  • Enter the Directory (tenant) ID that you got after creating an app at the Azure AD dashboard.
  • Enter the callback URL

Note: the callback URL that you set here should be the same as the app that you create at the Azure AD dashboard and add the /azure/azure/Oauth to the end of your store URL.

E.g: https://example.com/azure/azure/Oauth

Login at Magento 2 Store – Magento 2 Azure AD Login

The registered user of the Azure AD on the Magento 2 store login page can see the button “Login Using Azure”.

Magento 2 Azure AD Login

Tapping the Login With Azure button redirects the user to the Azure AD login page. After that, the user will have to enter the password that they have set or can receive a code that can be entered to log in.

enterPassword

Enter the password and tap the Sign in button to login into the Magento 2 customer account directly.

enterred-password-now-login-

The user is logged in to the Magento 2 customer account.

Magento 2 Azure AD Login account created

After registration, the admin can view the list of customers who have registered via Azure Ad SSO login.

Magento 2 Azure AD Login customer list for SSO

That is all about the Magento 2 Azure AD Login. If you have any queries regarding the plugin, please contact us at Webkul Support System.

You can also check our complete Magento 2 extensions.

Current Product Version – 4.0.0

Supported Framework Version – Magento 2.0.x, 2.1.x, 2.2.x,2.3.x, 2.4.x


Source link