This project generates tokens using Google authentication services, with necessary dependencies for handling HTTP requests, Google APIs, and OAuth2 authentication.
-
app/libs/
: Contains external dependencies required for the project.- Google API client libraries
- Google authentication libraries
- Guava utility library
- Gson (JSON parsing library)
- Apache HTTP client libraries
- OpenCensus and gRPC (for monitoring, tracing, and network communication)
-
app/src/
: Contains configuration and resource files for the project.credentials.json
: Service account credentials for Google APIs authentication.Main.java
: The main Java application file responsible for initializing the token generator process. It handles OAuth2 authentication, refreshing tokens, and communicating with Google's API services.
-
app/build.sh
: A shell script used to download the required dependencies (JAR files) from Maven repositories. This script will set up thelibs/
directory and ensure all necessary libraries are available for the project to function properly.
This project requires the following external libraries:
-
Google HTTP Client Libraries:
google-http-client-gson-1.42.3.jar
google-api-client-gson-1.33.2.jar
google-api-client-1.33.2.jar
-
Guava (Utility Library):
guava-23.1-jre.jar
-
Google Authentication Libraries:
google-auth-library-oauth2-http-1.20.0.jar
google-auth-library-credentials-1.20.0.jar
google-http-client-1.42.3.jar
-
JSON Parsing:
gson-2.9.0.jar
-
Apache HTTP Client Libraries:
httpclient-4.5.13.jar
httpcore-4.4.13.jar
-
OpenCensus and gRPC (For tracing and monitoring):
opencensus-api-0.28.3.jar
opencensus-contrib-http-util-0.28.3.jar
grpc-context-1.45.1.jar
grpc-core-1.45.1.jar
-
Clone the repository:
git clone https://github.com/YsrajSingh/google-access-token-generator cd google-access-token-generator
-
Download Dependencies: This project uses external dependencies hosted on Maven. To ensure the necessary JAR files are available, the following script downloads them:
./app/build.sh
This will create the app/libs/ and download the required libraries.
-
Run the Project:
After setting up the dependencies, you can run the project using:
docker-compose up
This will start the container and load the necessary credentials to generate tokens using Google APIs.
-
Modify Credentials
Ensure that your credentials are correctly configured in the project, especially if using Google APIs. You'll need to have a service account JSON file with the required permissions. Update the credentials in the Main.java or corresponding Java file.
If you are not using OpenCensus or gRPC for tracing and monitoring, you can remove the following dependencies:
opencensus-api-0.28.3.jar
opencensus-contrib-http-util-0.28.3.jar
grpc-context-1.45.1.jar
grpc-core-1.45.1.jar
This project is licensed under the MIT License - see the LICENSE file for details.