Identity Register and Login redirect not working after deploying to App Service

DMur 46 Reputation points
2020-06-22T12:58:23.107+00:00

Hi folks,

My entity framework identity register and login redirects are working fine on localhost, but after deploying to app service I get a page not found error.

Im about ready to try a different hosting solution to resolve this. If anyone can offer any advice it would be much appreciated. Details here:

https://stackoverflow.com/questions/62467027/asp-net-core-scaffolded-register-and-login-redirect-not-working-in-azure-app

Thank you.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,972 questions
0 comments No comments
{count} vote

2 answers

Sort by: Most helpful
  1. Santosh Kumar Gada 76 Reputation points
    2020-06-23T02:51:17.257+00:00

    Hi,

    The reason is, you have used the submit button(as below), which is uses the Post HTTP verb. Please do use the Anchor tag(link) or Input type button to navigate to the login page and outsource you can present the Anchor tag as button using CSS.

    <button type="submit" class="btn btn-primary" asp-area="Identity" asp-page="Register" id="RegisterButton">@_loc[Model.RegisterButtonName]</button>

    Happy coding!!


  2. VJeam 1 Reputation point
    2021-01-05T22:02:15.357+00:00

    Hi,

    I am facing the same issue as described above (webapp works locally but not when hosted on Azure), although slightly different:

    I managed to get the page to redirect by enabling the App Service Auth as seen below
    53724-image-2021-01-05-225655.png

    The issue I am now facing is that the App is not redirecting me directly towards the Login and Register section. I have to press CTRL+F5 repeatedly or else the website stays stuck...

    Here is the technology I am using:

    • ASP.Net Core v3.1.9
    • IdentityServer4 hosted within the App
    • Scaffolded Identity
    • React.js as a frontend
    • SQLite in dev, MS SQL via Azure in production
    0 comments No comments