c# - ASP.NET Core Google Sign In Returns 403 -


i know missing obvious, cannot figure out is. i'm trying make simple 'login google' test app, , after google consent screen, follows 403 on site.

in startup, configure cookie , google:

app.usecookieauthentication(new cookieauthenticationoptions {     authenticationscheme = "cookies",     automaticauthenticate = true,     automaticchallenge = true,     loginpath = new microsoft.aspnetcore.http.pathstring("/account/login"),     accessdeniedpath = new microsoft.aspnetcore.http.pathstring("/account/denied") });  app.usegoogleauthentication(new googleoptions {     authenticationscheme = "google",     signinscheme = "cookies",     clientid = "xxx"                                                                           clientsecret = "xxx"                                                                      automaticchallenge = true }); 

i've configured google api hit endpoint middleware creates:

enter image description here

but callback google http://localhost:5000/signin-google?state=xxxxxxx gives me 403 error. developer exceptions page shows:

enter image description here

my login method simply:

[httpget("login")] public iactionresult login(string returnurl) {    return challenge(new authenticationproperties    {        redirecturi = returnurl ??  "home/index"    }); } 

can me flawed understanding?

gah. got it. turns out app configured correctly. had 'enable' google+ api in google's console api:

enter image description here

if knows reasoning behind this, or why it's not obvious need this, i'd know.


Comments

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -