c# - Migrate web forms ASP.NET Membership OpenAuth for Google from OpenID 2.0 to OpenID Connect -


i have existing web forms site utilizes built-in asp.net membership openauth model. has worked on year , half, found out google has deprecated openid 2.0 , shut down on april 20, 2015 (just on week).

this abstraction bites in ass, because have single line of code in authconfig.cs

openauth.authenticationclients.addgoogle(); 

i've updated of openauth related nuget packages, hoping there fix under covers - no joy.

is there easy solution this, or need strip out , rewrite google authentication piece?

(lots of questions related this, haven't found related web forms membership.openauth implementation.)

the nuget package "dotnetopenauth oauth2 client google" solved me.

in authconfig.cs, replace openauth.authenticationclients.addgoogle(); with:

var client = new googleoauth2client(clientid, clientsecret); var extradata = new dictionary<string, string>(); openauth.authenticationclients.add("google", () => client, extradata); 

get string values clientid , clientsecret setting google app.

in page responding redirect uri register google, add googleoauth2client.rewriterequest() before existing call openauth.verifyauthentication(redirecturl).


Popular posts from this blog