I have a project where I am running headed (w/ monitor) on my Rasp Pi 2 and have it connected to the internet so I can get data from services hosted 3rd party as well as those I have stood up in Azure.
All of the REST calls are working fine. However, the oAuth portion of the google calendar call works only on my development machines and other machines with a built in browser.
Is there a way I can save whatever tokens get generated from a debug run on my dev machine and take that into the deployment on to the RP2?
I have my client_secret.json file properties in my .sln Build Action = Content and Copy to Output Directory = Copy Always
The code I have that works on my dev machines:
var credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(
new Uri("ms-appx:///client_secret.json"),
new[] { Uri.EscapeUriString(CalendarService.Scope.Calendar) },
calendarOwner,
CancellationToken.None);
var calendarService = new CalendarService(new BaseClientService.Initializer
{
HttpClientInitializer = credential,
ApplicationName = "myappname"
});
var calendarListResource = await calendarService.CalendarList.List().ExecuteAsync();
Any help or insight as to how I can get this running on my rp2 would be GREATLY appreciated! This is my first big stab at anything rp2 + win10iot stuff.
UPDATE: The exception I am receiving is as follows: Error:"UserCancel", Description:"The WebAuthenticationBroker didn't return a code or an error. Details:0", Uri:"" It jumps right to my catch block when axecuting AuthorizeAsync() method.