Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tonglil/iap-token-generator
Generate OAuth Bearer tokens for authenticating Service Accounts through GCP IAP
https://github.com/tonglil/iap-token-generator
google-cloud-platform iap oauth2 oidc
Last synced: 5 days ago
JSON representation
Generate OAuth Bearer tokens for authenticating Service Accounts through GCP IAP
- Host: GitHub
- URL: https://github.com/tonglil/iap-token-generator
- Owner: tonglil
- Created: 2018-09-11T03:16:19.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-09-12T06:32:48.000Z (about 6 years ago)
- Last Synced: 2024-06-21T20:10:02.201Z (5 months ago)
- Topics: google-cloud-platform, iap, oauth2, oidc
- Language: Go
- Homepage: https://hub.docker.com/r/tonglil/iap-token-generator/
- Size: 1.46 MB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# IAP Token Generator
Generate OIDC tokens to use in HTTP requests for the `Authorization: Bearer` header to make authenticated requests to Cloud IAP-secured resources.
Implements [this flow](https://cloud.google.com/iap/docs/authentication-howto#authenticating_from_a_service_account) outlined by the GCP documentation.
Thanks to https://github.com/b4b4r07/iap_curl for implementing the OAuth flow.
## Options
```
$ iap-token-generator -h
Generate a Bearer token for making HTTP requests to IAP-protected appsUsage:
iap-token-generator [flags]Flags:
-c, --credentials string The service account JSON credential [GOOGLE_APPLICATION_CREDENTIALS]
-f, --filename string Write the token to a file
-h, --help help for iap-token-generator
-i, --id string The IAP client ID [IAP_CLIENT_ID]
-r, --refresh duration Refresh the token on a specified interval
```## Usage
1. Run as a sidecar container, refresh and output the token to a file that is read by the main application.
1. Run with refresh and consume the token from stdout.
1. Run as a subcommand with `curl --header "Authorization: Bearer $(iap-token-generator)" ...`