Can I get Google OAuth2 to display a mobile approval page?

I am working on a mobile application that will hit some Google APIs by authenticating using OAuth2.

This works very well, but when I move on to Uri approval, Google returns what looks like a full-blown version of the desktop application approval. This doesn’t look so bad, but I would rather have a cleaned mobile version that you could request for Google OAuth 1.

(from http://code.google.com/apis/accounts/docs/OAuth_ref.html )

btmpl

(optional) Forces a mobile version of the approval page. The only accepted value is "mobile". This is a Google-specific parameter.

I tried to add it to the OAuth2 Uri statement, but without joy. Therefore, if I use the auth application installed by Google , are there any options to indicate that the request comes from a small screen device?

The oauth endpoint that I use:

https://accounts.google.com/o/oauth2/auth?response_type=code&redirect_uri=http://localhost&scope=https://www.googleapis.com/auth/userinfo.profile&client_id=XXXXXXX.apps.googleusercontent.com
+5
source share
1 answer

The OAuth 2.0 URL you are dealing with already has a mobile version available. However, unlike OAuth 1.0 URLs, there is no URL parameter to enforce it; instead, it uses user agent discovery to display the corresponding version depending on the browser. At least it works fine on my Android device (although I haven't tried it with any other devices yet).

+1

All Articles