MVC google login - OpenID auth request contains an unregistered domain

后端 未结 3 1371
没有蜡笔的小新
没有蜡笔的小新 2020-12-10 04:58

When I try to login today via google in my web app, I get that error:

400 That’s an error.

OpenID auth request contains an unregistered do

3条回答
  •  无人及你
    2020-12-10 05:22

    This approach is obsolete as Google changed their auth to OAuth2

    I didn't delete this answer because formerly approved api users are still valid to use.

    == Original post below ==

    If you are OWIN-based MVC5 user, just change Startup.Auth.cs file

            app.UseGoogleAuthentication();
    

    to

    app.UseGoogleAuthentication(
     clientId: "000-000.apps.googleusercontent.com",
     clientSecret: "00000000000");
    

    according to the http://www.asp.net/mvc/tutorials/mvc-5/create-an-aspnet-mvc-5-app-with-facebook-and-google-oauth2-and-openid-sign-on page.

提交回复
热议问题