Carlos Guilherme Simões
unread,Apr 8, 2015, 11:24:31 AM4/8/15Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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