go-iap-oauth2-sample

command module
v0.0.0-...-c5d57b2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 10, 2021 License: MIT Imports: 7 Imported by: 0

README

GCP IAP Oauth2 with Golang Sample

This is a sample code for access GAE standard through IAP.

Before User

  1. Setup a GAE web server.
  2. Setup a IAP for GAE.
  3. Create a service account only for access GAE through IAP.
  4. Download the service account key json file.
  5. Get IAP client ID.

More detail

Use

$ GAE_WEB_URI="<YOUR_GAE_URL>" \
CLIENT_ID="<YOUR_IAP_CLIENT_ID>" \
SEVICE_ACCOUNT_KEY_PATH="<YOUR_JSON_KEY_PATH>" \
go run ./main.go

for exmaple:

$ GAE_WEB_URI="https://<PROJECT_ID>.appspot.com" \
CLIENT_ID="<RANDOM_STRING>.apps.googleusercontent.com" \
SEVICE_ACCOUNT_KEY_PATH="key.json" \
go run ./main.go

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL