asp.net mvc - Google Middlewire Authentication in MVC Core -


i trying add google authentication in mvc application. followed steps , registered middlewire in configure method in startup.cs

   app.usegoogleauthentication(new googleoptions         {             clientid = configuration["google:clientid"],             clientsecret = configuration["google:clientsecret"],             scope = { "email", "openid" }          }); 

i saving clientid , clientsecret in appsettings.json.

in developers.google.com using g+ api signin purposes.

using https://localhost:44386 authorized javascript origins

and https://localhost:44386/signin-google authorized redirect uris

the issue page shows allow , deny access page , upon clicking on allow ,the page stays in loading state , never redirects externalloginconfirmation.cshtml page.

using default single user authorization mvc core template this. doing wrong.

this output stream mvc core app.

microsoft.aspnetcore.hosting.internal.webhost:information: request starting http/1.1 http://localhost:61356/signin-google?state=cfdj8mgrze29tkljksjpdlbdmwee9w4z9qkrqyko5mov7fhppd2rtleeuubp0nfxz-edch6rmidobej-88mvueg1a_-x087pvbicroytddbl1mnqymxgan7pimaohra_c5xcprgr3g73gvme-qk4km2tqo5ip-25cctwysqymdd3ham2pmwo5cbwoabnavk9tu0ym2xoowrstcugeusqecuj8flgrmjybmrbw-mtsxdukrhu6klg7kuze48fyjg2o9bhq68js5f3sa9_q2bqxr2dkg4mry5vmvjoadmcuace6mfoneeqcgem0j71cdfuiaw46g&code=4/f179kp-wofrd88abqpdrssfynorwes3gun7bhhvcw0a&authuser=0&hd=motorolasolutions.com&session_state=f02757ef58689502dbceb4b6cc6bd131dfa2d805..5a04&prompt=consent microsoft.aspnetcore.authentication.cookies.cookieauthenticationmiddleware:information: cookies not authenticated. failure message: unprotect ticket failed 

its saying cookies not authenticated. failure message: unprotect ticket failed.


Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -