Skip to content

Latest commit

 

History

History
23 lines (20 loc) · 976 Bytes

README.md

File metadata and controls

23 lines (20 loc) · 976 Bytes

Retrofit OAuth

A small demo how to use Retrofit to retrieve an OAuth2 access token from a Google account and use it to read the user's Google profile.

Run the demo

  1. create a new project: console.developers.google.com, and go to
    • APIs & auth
      • Credentials
        • Create New Client ID
        • Installed application and Other
        • Create Client ID
        • copy the Client ID and Client secret
      • APIs
        • enable Google+ API
  2. create a file called local.properties in the root of this project and add the keys client_id and client_secret to it (and the corresponding values from step 1, of course)
  3. run the main class by executing mvn exec:exec, and follow the instructions on the console