1

Hoping someone has come across this issue before;

I am building a Universal Windows Platform (UWP) App on Windows 10 that consumes data from the Google Web Master Tools API and when I try to authorise using the Google Web Authorization Broker I run into the following exception:

InnerException = {System.NotSupportedException: Failed to launch browser with "https://accounts.google.com/o/oauth2/v2/auth?access_type=offline&response_type=code&client_id=437110116900-jfsnbikhkj8l4aetubtkn52ggki45nm0.apps.googleusercontent.com&redirect_uri=http:%2F%2F127....

Code snippet:

string[] scopes = new string[] {
                WebmastersService.Scope.Webmasters
            };

using (var stream = new FileStream("client_secret.json",
                                   FileMode.Open, FileAccess.Read))
                {
                    UserCredential credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
                    GoogleClientSecrets.Load(stream).Secrets,
                    scopes,
                    userName,
                    CancellationToken.None,
                    new FileDataStore(".", true)).Result;
                }

Thanks in advance :)

Cheers, Paul

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449
Paul MaC
  • 11
  • 2
  • I found this little gem in the release notes for the control: - UWP (will build, but is known not to work at runtime) Seems I'm wasting my time with this method. – Paul MaC Jun 17 '17 at 06:18

1 Answers1

0

The Google APIs .net client library does not support UWP at this time. see Investigate UWP support #983

The problem is launching the browser to authenticate the library doesn't have the ability to do so on a UWP app.

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449