Demonstrates using Google OAuth to access a Google Suites directory then list the users using the Google Admin SDK.
You must first have a Google account and then register the Admin SDK API in a new project using the Google Developers Console; see https://code.google.com/apis/console. Once you have created a new project you will have to set up a redirect URI in the OAuth credentials tab. In our case the redirect URI is:
http://localhost:8080/google-client/api/oauth2/authorize
This project requires Java and Maven. Use at least version 1.8 of the Java JDK. Try out AdoptOpenJDK or Zulu Community OpenJDK.
Clone this repository.
git clone https://github.com/gkhays/googleapps-client.git
Have the OAuth client and secret from the Getting Started section, above, ready to go.
Then execute:
mvn clean package jetty:run
Eclipse IDE for Enterprise Java Developers.
Version: 2018-12 (4.10.0)
Build id: 20181214-0600