i need use popup window google oauth authentication. using dotnetopenauth library authentication , working on same page. how can on popup window. have around googling , have found few , 1 of them " specify request parameters in dotnetopenauth 4" way using library don't know can set popup window.
this code.
private string accesstoken { { return (string)session["googleaccesstoken"]; } set { session["googleaccesstoken"] = value; } }
private static readonly googleclient googleclient = new googleclient { clientidentifier = configurationmanager.appsettings["googleconsumerkey"], clientcredentialapplicator = clientcredentialapplicator.postparameter(configurationmanager.appsettings["googleconsumersecret"]), }; protected void page_load(object sender, eventargs e) { if (googleclient != null) { if (!ispostback) { var authorization = googleclient.processuserauthorization(); if (authorization != null) { this.accesstoken = authorization.accesstoken; } else if (this.accesstoken == null) { googleclient.requestuserauthorization(scope: new[] { googleclient.scopes.webmaster.siteverification, googleclient.scopes.webmaster.webmastertools }); } } } } private static readonly authorizationserverdescription googledescription = new authorizationserverdescription { tokenendpoint = new uri("https://accounts.google.com/o/oauth2/token"), authorizationendpoint = new uri("https://accounts.google.com/o/oauth2/auth"), protocolversion = protocolversion.v20, };
could please me on (i new asp.net)? thanks
if want library has support client-side instrumentation, including opening popup windows result of button click, might want javascript api:
https://developers.google.com/api-client-library/javascript/features/authentication
Comments
Post a Comment