| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
This sample shows how to implement an OAuth 2.0 flow using the Google OAuth Client Library for Java to access protected data stored on Google services. OAuth 2.0 is a standard specification for allowing end users to securely authorize a client application to access protected server-side resources.
gcloud init
gcloud app create
git clone https://github.com/GoogleCloudPlatform/java-docs-samples
cd java-docs-samples/appengine-java11/appengine-simple-jetty-main mvn install
In the Cloud Developers Console > API Manager > Credentials, create a OAuth Client ID for a Web Application. You will need to provide an authorized redirect URI origin: https://<PROJECT_ID>.appspot.com/oauth2callback.
Replace CLIENT_ID and CLIENT_SECRET with these values in your app.yaml
Move into the appengine-java11/oauth2 directory and compile the app:
cd ../oauth2 mvn package
mvn clean package appengine:deploy -Dapp.deploy.projectId=<your-project-id>
To view your app, use command:
gcloud app browse
Or navigate to http://.appspot.com URL.
| Back | FazBrowse Home | New Git URL |