Android Google Authorization

How to Enable Oauth2 Authorization for your application in Android

Things you need

  1. First create an api project https://console.developers.google.com/project
  2. Enable the API that you want to use in that project, such as AdSense Management API
  3. Create a client id in that api project. The client id will be for installed application, Android and then you have to provide the SHA1 finger print, for debug (get it from eclipse->Windows->Preference->Android->Build) and for the release build you have to get it from your personal keystore that you use to sign your applications.
  4. Make sure that you fill out the consent screen with the correct info.  Defining the consent screen is very important. Once you define the consent screen, you can see all the applications that you gave permission to use your information can be found at https://security.google.com/settings/security/permissions. If you don’t define the consent screen, then the first time you create a client ID, using the SHA1 fingerprint from either the debug store or your personal keystore, you will get some consent screen. Even after you give permission that app name won’t appear in the link provided above. So somehow if you manage to revoke the permission that you gave to that app, then your app won’t go through the consent process again and instead you get GoogleAuthException Unknown, which will be very difficult to get out of.

 

 

 

Posted in Uncategorized

Comments are closed.