Test App Service Authentication on localhost

Shuo-Yang Wang 0 Reputation points
2023-08-31T01:37:15.3266667+00:00

I set up Facebook Authentication on my web service and added 127.0.0.1:3000/<my_path> to "Allowed external redirect URLs". The prod works fine and I can get authenticationToken in the returned URI fragment. Therefore, I tried to do the similar thing in localhost, I first hit https://<my_domain>/.auth/login/facebook?post_login_redirect_uri=https://127.0.0.1:3000/<my_path> in the browser bar and get authenticationToken successfully. However, when redirecting from a link in my page <a href="https://<my_domain>/.auth/login/facebook?post_login_redirect_uri=https://127.0.0.1:3000/<my_path>">link</a>, there is no authenticationToken returned.

Setting:

Screen Shot 2023-08-30 at 9.31.50 PM

Prod:

Screen Shot 2023-08-30 at 9.19.04 PM

Localhost redirecting from browser bar:

Screen Shot 2023-08-30 at 9.28.25 PM

Localhost redirecting from a link in my page:

Screen Shot 2023-08-30 at 9.24.21 PM

What's the difference between entering the login flow from browser bar and redirecting from a link? How should I test login flow locally?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,935 questions
{count} votes

1 answer

Sort by: Most helpful
  1. ajkuma 28,036 Reputation points Microsoft Employee Moderator
    2023-09-06T12:25:39.2233333+00:00

    Shuo-Yang Wang,

    Edit:
    Logging for App Service auth should work by setting FileSystem logging to Verbose - Logging and tracing, and see if this provides some pointers.

    Kindly let us know how this goes, we can also engage with you further offline.

    Apologies for the delay on this, we wish to engage with you offline for a much closer look, please send an email with subject line “Attn:Ajay” to AzCommunity[at]Microsoft[dot]com with the following details, I will follow-up with you. 

    1.     Referencing this thread,

    2.     Azure subscription ID,

    3.     Azure resource name and the time of issue occurrence.


    If the answer helped (pointed, you in the right direction) > please click Accept Answer

    1 person found this answer helpful.
    0 comments No comments

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.