can we have different redirect url for the paths gaurded by msal?

Miguel 280 Reputation points
2023-03-16T16:42:49.1166667+00:00

I have gaurded some routes on my website using msal, and the redirect ur is something like myurl.com, now the issue is that I want to redirect users to a path thats is gaurded when hitting on a button, but before redirecting them, myurl.com flashes, how can I solve this issue?thanks.

I used the msal sample project on the documentation

Microsoft Security | Microsoft Entra | Microsoft Entra ID
{count} votes

Accepted answer
  1. Shweta Mathur 30,296 Reputation points Microsoft Employee Moderator
    2023-03-23T11:33:38.1366667+00:00

    Hi @Miguel ,

    Thanks for reaching out.

    I understand you're experiencing a flash of the myurl.com page before the user is redirected to the secured page after clicking the button.

    This might be due to the redirect URL is set to your website's root domain ie. myurl.com, which causes the initial unsecured page to load briefly before the authentication process completes and the user is redirected to the secured page.

    To solve this issue, you could set the redirect URL to the specific path that you want the user to be redirected to after authentication. For example, if you want to redirect the user to "myurl.com/secure-page" after authentication, you can set the redirect URL to "myurl.com/secure-page" instead of "myurl.com".

    Hope this will help.

    Thanks,

    Shweta

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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