Microsoft Entra ID is redirecting user to wrong reply url localhost:8080

blest 5 Reputation points
2024-08-29T15:34:10.29+00:00

I've an Azure Web App, with the following Single Page Application Redirect URIs:

https://dummy-portal.myorg.net/my-app
https://dummy-portal.myorg.net
https://dummy-portal.ppd.myorg.net/my-app
https://dummy-portal.ppd.myorg.net
https://dummy-portal.azure.myorg.net/my-app
https://ppd-dummy-portal.azure.myorg.net/my-app
http://localhost:8080/myApp

Once the user hits my web url, they are redirected to the MS Sign In page.

However for my preproduction deployment ppd; the user is being redirected to localhost:8080/my-app instead of the actual ppd url.

I've verified my Angular MSAL, and it's not with the code but Azure only. Please help me on the.

As of now my prod is working fine, and I'm really worried that it might get broke as well, as the preprod was also working fine for >2 years, and suddenly started this issue.

Azure App Configuration
Azure App Configuration
An Azure service that provides hosted, universal storage for Azure app configurations.
Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Sergio Andrés Vargas Acosta 75 Reputation points
    2024-08-29T16:56:53.9833333+00:00

    Hi.

    Ensure that the redirect URIs configured in Azure Entra ID for your application match the correct ones, particularly for the preproduction (ppd) environment. Verify that your Angular application's MSAL configuration aligns with the proper URIs for each environment, avoiding redirection to localhost:8080 unless it’s during local development.


  2. Bruce (SqlWork.com) 81,206 Reputation points Volunteer Moderator
    2024-08-29T19:34:10.5166667+00:00

    when your app redirects to azure to login, it passes the redirect url. azure just validates the url is on the reply list, else it gives an error. so the issue is with your app.

    0 comments No comments

  3. Sergio Andrés Vargas Acosta 75 Reputation points
    2025-10-01T21:29:03.73+00:00

    Entra ID doesn’t decide where to send users back; it just validates the URL your app includes in the login request. If you’re seeing it redirect to http://localhost:8080/..., that means your Angular/MSAL app is still passing that as the redirect_uri, and Entra ID allows it because it’s registered on the reply to URL list.

    The best step is to check the redirectUri setting in your preprod environment files or your deployment pipeline. To confirm quickly, open the browser’s network tab, capture the login request, and see what redirect_uri is being sent. If it shows localhost, then the app is still pulling that value from its config.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.