# Not able to logged in using discourse-azure-ad auth plugin

**URL:** https://meta.discourse.org/t/not-able-to-logged-in-using-discourse-azure-ad-auth-plugin/106201
**Category:** Support
**Created:** [January 10, 2019, 3:04pm UTC](https://meta.discourse.org/t/not-able-to-logged-in-using-discourse-azure-ad-auth-plugin/106201 "2019-01-10T15:04:38Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Subham\_Joshi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/subham_joshi/32/127591_2.png) [@Subham\_Joshi](https://meta.discourse.org/u/Subham_Joshi)
#### Post date: [January 10, 2019, 3:04pm UTC](https://meta.discourse.org/t/not-able-to-logged-in-using-discourse-azure-ad-auth-plugin/106201/1 "2019-01-10T15:04:38Z")

</div>

We need to integrate the discourse with Azure AD using [discourse-azure-ad](https://github.com/discourse/discourse-azure-ad) plugin.

**Configuration on discourse -**

- Add the plugin Github link inside the app.yml file inside the containers directory.
- Add the Azure application client Id as `DISCOURSE_AZURE_CLIENT_ID` in app.yml.
- Add the Azure application client secret as `DISCOURSE_AZURE_CLIENT_SECRET` in app.yml.  
Re-build/Re-deploy the discourse image in docker.

**Configuration on Azure AD -**

1. Login to azure portal, select “Azure Active Directory” from main left side menu.
2. Click on “App Registrations” & a wizard form opens.
3. Select “New registration” from top sub header.
4. Give a name & Select supported account types.
5. Now select the newly created application inside App registrations & open it.
6. Select 'Authentication" from left sub-menu.
7. Now add the redirect url as callback url `https://discourse-domain/auth/azure_oauth2/callback` & hit save.
8. Check Implicit grand as “Access Token”.
9. Select the “Certifications & secrets” from left sub-menu & create one client secrets.
10. For adding a new secret key, give a description & expiry time.
11. Select “API Permissions” and check if Microsoft graph user.read permission (Sign in and read user profile) is available.

But we are not able to logged in.  
When we tried logging in, it redirects to login.microsoft for login.  
but after entering credentials - it came back to the callback url & refreshes for forever.(it reloads the page with various callback urls.)

Please help. 🙂

 ![42%20PM](https://global.discourse-cdn.com/meta/original/3X/9/7/97d3d11538ab24a4e8f44b4ba8be3f87e71b237c.png)

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [January 23, 2019, 10:28pm UTC](https://meta.discourse.org/t/not-able-to-logged-in-using-discourse-azure-ad-auth-plugin/106201/3 "2019-01-23T22:28:04Z")

</div>

@Subham_Joshi I’m going to close this topic in favour of your more recent one on the same topic

[https://meta.discourse.org/t/open-id-connect-email-field-not-populated-while-signup-token-claim-emails/106733/2?u=david](https://meta.discourse.org/t/open-id-connect-email-field-not-populated-while-signup-token-claim-emails/106733/2)

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [January 23, 2019, 10:28pm UTC](https://meta.discourse.org/t/not-able-to-logged-in-using-discourse-azure-ad-auth-plugin/106201/4 "2019-01-23T22:28:10Z")

</div>


