Why MVC 5 Owin Oauth is not hitting /Account/ExternalLoginCallback action

前端 未结 5 510
孤街浪徒
孤街浪徒 2021-01-12 08:31

I am new to MVC 5 authentication. Currently I tried Google Authorization using Owin The code in startup.Auth.cs

var googleOAuth2Authenticati         


        
5条回答
  •  渐次进展
    2021-01-12 09:15

    You have add the follow in order to map the route in RouteConfig.cs because Google sends the response to yourdomain/signin-google.

    public static void RegisterRoutes(RouteCollection routes)
            {
                ...
    
                routes.MapRoute(name: "signin-google", url: "signin-google", defaults: new { controller = "Account", action = "ExternalLoginCallback" });
            }
    

提交回复
热议问题