Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Google AuthSub token from android app

I'm writing an android program which must interact with google documents, so I have watched this sample, but it uses an AuthSub token. How can I get an AuthSub Token from an android app?

like image 919
Aram Avatar asked May 31 '26 03:05

Aram


1 Answers

For accessing Google Docs or any other Google service (or any OAuth based service for that matter) you will need to find a way to do an OAuth based authentication, after which you can u get a secure token which you can use to access a service based on the users credentials.

There are some really good examples to get you started:

  • This is an example of getting AccountManager to work with a Google service like Google Tasks, this shows you how to generate tokens and then how to use them: https://developers.google.com/google-apps/tasks/oauth-and-tasks-on-android

  • This is an in-depth look into how you can authenticate based on the users Android credentials, has an example of how things work and how the UI should be: http://www.finalconcept.com.au/article/view/android-account-manager-step-by-step-2

For something specific to Google Docs have a look at

  • http://code.google.com/p/google-api-java-client/wiki/Android
  • http://code.google.com/p/gdata-java-client/source/browse/trunk/java/sample/docs/DocumentResumableUploadDemo.java
like image 122
Soham Avatar answered Jun 01 '26 17:06

Soham



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!