Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Xamarin.Auth request for Google

$
0
0

I've create a Xamarin.Auth's OAuth2Authenticator instance to authenticate with Google, for the purpose of posting Activities ("Moments" in their system).

First, I set the necessary Scope values to be able to authenticate & obtain the user's profile information. It worked successfully, getting me an Account instance and the Access Token.

However, using that Access Token to create a new Activity fails with a 401 Unauthorized. After some online research, it seems that the initial request must also make a request to be able to insert new activities. To do this, you need to specify the "request_visible_actions" value as part of the OAuth request, specifying the schema that you are attempting to add.

This all sounded fine, exception it seems that Xamarin.Auth does not work as expected when generating the request.

Specifically, these are my values.

Scope: email https://www.googleapis.com/auth/plus.login AuthorizeUri: https://accounts.google.com/o/oauth2/auth

I need to somehow specify "request_visible_actions=http://schemas.google.com/AddActivity", but there does not seem to be a way to specify additional parameters on the request. I attempted to add it to the AuthorizeUri values, changing it to

AuthorizeUri: https://accounts.google.com/o/oauth2/auth?request_visible_actions=http://schemas.google.com/AddActivity

But this causes the Google UI to report back that the "client_id" value is not specified, however I can clearly see it as part of the "Request Details" that the interface reports back (http://screencast.com/t/8jJXFvnUI - I've blacked out the bulk of the actual Client Id)

I tried encoding the "http://schemas.google.com/AddActivity" Url, in case somehow it was causing a problem, but no changes.

I'm assuming that specifying it on the AuthorizeUri is likely the wrong approach, but I'm not seeing any other way...

Any help would be greatly appreciated.


Viewing all articles
Browse latest Browse all 204402

Trending Articles