Asp.net core Identity successful login redirecting back to login page

后端 未结 6 941
长情又很酷
长情又很酷 2020-11-30 12:38

I have a problem where the asp.net identity framework is redirecting the user back to the login page after they have logged in successfully.

This is using the stand

6条回答
  •  没有蜡笔的小新
    2020-11-30 13:36

    In addition to @Kirk Larkin answer if you use .net core 3 (in this time is preview version)

    put your "app.UseEndpoints" in startup.cs to end of the code block.

    for example it should be in this order

            app.UseAuthentication();
            app.UseAuthorization();
    
            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllerRoute(
                    name: "default",
                    pattern: "{controller=Home}/{action=Index}/{id?}");
                endpoints.MapRazorPages();
            });
    

提交回复
热议问题