GoogleWebAuthorizationBroker.AuthorizeAsync - not open authentication popup...

350 views
Skip to first unread message

Carlos Guilherme Simões

unread,
Apr 8, 2015, 11:24:31 AM4/8/15
to google-api-d...@googlegroups.com
Hello everyone...

I have a problem in the permit application for authentication.
My application runs on IIS7 (framework 4.0).


Code:

string[] scopes = new string[] { Google.Apis.Oauth2.v2.Oauth2Service.Scope.UserinfoEmail, Google.Apis.Oauth2.v2.Oauth2Service.Scope.UserinfoProfile, Google.Apis.Oauth2.v2.Oauth2Service.Scope.PlusLogin, // Get basic User Info AnalyticsService.Scope.Analytics, // view and manage your analytics data AnalyticsService.Scope.AnalyticsEdit, // edit management actives AnalyticsService.Scope.AnalyticsManageUsers, // manage users AnalyticsService.Scope.AnalyticsReadonly }; // View analytics data

string clientId = "XXXXXXXXXXXX";
string clientSecret = "ZZZZZZZZZZZZZ";

MemoryDataStore mData = new MemoryDataStore();
UserCredential credential;

using (var cts = new CancellationTokenSource())
{
cts.CancelAfter(TimeSpan.FromSeconds(30));
credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
new ClientSecrets { ClientId = clientId, ClientSecret = clientSecret }
, scopes
, "F2F" // I changed it many times
, cts.Token
, mData).Result;
// ==> dont open a popup logon... and I get timeout!
}

return credential.Token.RefreshToken;



If someone can help me!

[]'s
Guilherme

Linda Lawton

unread,
Apr 20, 2015, 3:34:06 PM4/20/15
to google-api-d...@googlegroups.com
any chance you will share the code for MemoryDataStore();

this concept is intriguing.
Reply all
Reply to author
Forward
0 new messages