Drupal

How to Resolve OAuth Redirect URI Mismatch in Drupal with Entra ID / Azure AD B2C?

16 views 0

When integrating Drupal with Azure AD B2C using the miniOrange OAuth Client module, you may encounter a “Redirect URI mismatch” error. This typically occurs when the URI sent from Drupal does not match the URI registered in Entra ID / Azure AD B2C.

Symptoms:

  • Users cannot log in via EntraID / Azure AD B2C.
  • Error message: “The redirect URI does not match the registered URI for this application.”
  • The module may still reference a development or old site URL.

Step 1: Verify Callback/Redirect URI in Drupal

  1. Navigate to your Drupal site:
    Drupal Admin → miniOrange OAuth Client Module → Configure OAuth tab
  2. Locate the Callback/Redirect URI field.
  3. Copy the URI for use in Azure AD B2C.

 

Step 3: Clear Drupal Cache

After updating Azure AD B2C:

  1. Clear the Drupal cache to apply the new settings.

    • Configuration → Performance → Clear all caches
  2. Test the OAuth login flow again.

 

Step 4: Troubleshooting & Best Practices

  • Ensure the URI in Drupal exactly matches the Azure AD B2C entry.
  • Avoid extra spaces, trailing slashes, or mismatched case.
  • If using multiple environments (dev, staging, prod), register all necessary URIs in Entra ID / Azure AD B2C
  • Clear browser cache or try using an incognito window if issues persist.

Was this helpful?


Hello there!

Need Help? We are right here!

support