我正在尝试使用Google认证API在我的网络API项目上进行Google登录。创建了OAuth
我启用了Google+ API
在Client ID
Client Secret
和Startup.Auth
app.UseGoogleAuthentication(new GoogleOAuth2AuthenticationOptions()
{
ClientId = "497652290327-gd5h0lrheuqcrtccp2c4rqi8dt5vpfb8.apps.googleusercontent.com",
ClientSecret = "sPGGSo2d7VZX7YnRNGmCPQDv"
});
但是当我尝试登录URI dispalys
时http://localhost:54388/#error=access_denied
它消耗了我,因为我遵循了kudvenkat
教程中的每一步,但仍然遇到此错误。我做错了什么
请注意,我在此Google登录时使用的凭据在我的数据库中不存在(如果这很重要)
答案 0 :(得分:0)
如果使用代码优先,请确保您具有最新的OWin / FacebookAuth Nuget程序包,并且您的应用程序具有与应用迁移的SQL数据库的有效连接字符串。 还要检查clientID和secret是否正确,在google API控制台上它应该在客户端应用程序上显示一些流量