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

AI-generated summary

Subham_Joshi is seeking help integrating Discourse with Azure AD using the discourse-azure-ad plugin. They’ve followed setup steps for both Discourse (adding plugin, client ID/secret in app.yml, rebuilding Docker image) and Azure AD (registering app, setting redirect URI https://discourse-domain/auth/azure_oauth2/callback, enabling Implicit Grant for Access Token, creating client secret, and granting Microsoft Graph User.Read permission). However, after logging in via Microsoft, users are redirected back to the callback URL and the page reloads infinitely with varying callback URLs, preventing successful login. david suggests closing this topic in favor of a more recent one addressing a similar issue: OpenID Connect email field not populated while signup token claim emails. A screenshot is attached showing the infinite redirect behavior.

We need to integrate the discourse with Azure AD using 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. :slight_smile:

@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