# Não consigo fazer login usando o plugin de autenticação discourse-azure-ad

**URL:** <https://meta.discourse.org/t/not-able-to-logged-in-using-discourse-azure-ad-auth-plugin/106201>\
**Category:** Product Support\
**Created:** [Janeiro 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:** 1\
**Showing post:** 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:** [Janeiro 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)

---

_[View the full topic](https://meta.discourse.org/t/not-able-to-logged-in-using-discourse-azure-ad-auth-plugin/106201)._
