Alternative to GoogleWebAuthorizationBroker.AuthorizeAsync

420 views
Skip to first unread message

Adam Cunnington

unread,
Jan 7, 2015, 11:43:43 AM1/7/15
to google-api-d...@googlegroups.com
Hi,

I'm unable to use GoogleWebAuthorizationBroker.AuthorizeAsync because I'm using Visual Studio 2010 and the await command is not supported.

I'm told I have to use await when calling GoogleWebAuthorizationBroker.AuthorizeAsync because it issues an asynchronous request which requires threading; specifically a CancellationToken parameter.

I have installed AsyncCTPLibrary which is supposed to provide backwards compatibility to VS2010, bringing in the await and async commands among others. I'm developing a script task for SSIS, not sure if this affects why it won't work.

I've tried for like 2 days to get this working but to no avail so I think I need an alternative to GoogleWebAuthorizationBroker.AuthorizeAsync to return a UserCredential.

Any help hugely appreciated!

I currently have this:
credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
clientSecret,
new[] { DfareportingService.Scope.Dfareporting },
"dfa-user",
System.Threading.CancellationToken.None,
new FileDataStore("DfaReporting.Sample"));

Thanks,
Adam

IanS

unread,
May 5, 2015, 12:40:59 PM5/5/15
to google-api-d...@googlegroups.com, adamcunni...@gmail.com
Hi Adam,

Can you remember if you found a solution for this? I'm currently locked in to using Visual Studio 2010 for a project also.

Thanks
Reply all
Reply to author
Forward
0 new messages