The new set of Google APIs could be used in Android with the Client Library and can be authenticated using

  1. OAuth1.0
  2. OAuth2.0
  3. Client Authentication (android).

Can someone show me an example of Client Authentication using GoogleAccountManager class? I can't get one working.

Also when I use OAuth2.0 and use a redirect URL like buzz-sample:/// and add an intent filter to the Manifest like

<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="buzz-sample" />
</intent-filter>

It throws an error in the browser invalid-request: Invalid parameter value for redirect_uri: Missing authority: buzz-sample:///

Error 400

Any help would be appreciated.

有帮助吗?

解决方案

There's a pretty good example here that should do what you want. http://code.google.com/p/google-api-java-client/source/browse/buzz-v1-json-oauth2-android-sample/?repo=samples

Here's a small code snippet demonstrates how to use AccountManager#getAuthToken to get an AccessToken: http://chiarg.com/?p=429

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top