I have an angular application deployed on Azure App Services and have enabled Azure’s built-in authentication on it (aka Easy Auth). I am able to successfully login to my identity provider (AAD) but after being redirected to {domain}/.auth/login/aad/callback
, I am again further redirected to {domain}/.auth/login/done
. Any attempt to navigate back to the base URL just loops back around (since presumably whatever code or token produced hasn’t been sent back to the application).
/done
endpoint:
App registration redirect URIs:
Network request captured, showing the matching redirect URI:
Some more context: I only get this issue in the deployed instances. When building the front-end locally, the redirect URI is just set to localhost:4200
(defined in the SPA platform) and everything works as intended. However, just having {domain}/.auth/login/aad/callback
under the "SPA" platform led to a PKCE error, so I followed this post and added both "web" and "single-page application" platforms.
I have seen the following posts but they appear to be doing some authentication on the server side:
2
Answers
I created a simple Angular application with Azure AD and successfully deployed it to Azure App Service.
app.module.ts
andauth-config.ts
as theredirectUri
before deploying it to Azure App Service.app.module.ts:
auth-config.ts:
app.component.ts:
Here’s the output after deployment:
If you’re using MSAL angular try disabling Azure’s built in authentication for the client side apps in app services.