Skip to content

It is a tool to be authorized with OAuth 2.0(Authorization Code Flow with Proof Key for Code Exchange) and access Google API.

License

Notifications You must be signed in to change notification settings

x-color/google-oauth-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Google OAuth CLI

It is a tool to be authorized with OAuth 2.0(Authorization Code Flow with Proof Key for Code Exchange) and access Google API.

Read this blog for details.

Usage

Before using the cli, you must prepare Google OAuth Client settings. See https://developers.google.com/identity/protocols/oauth2/native-app#prerequisites.

Install the cli

$ go install github.com/x-color/google-oauth-cli@latest
$ google-oauth-cli
This command has login, logout, email commands. Please use them.

Set environment variables

$ export CLIENT_ID=<CLIENT ID>
$ export CLIENT_SECRET=<CLIENT SECRET>

Authorize the cli with OAuth

$ google-oauth-cli login

Get your google account's mail address

$ google-oauth-cli email
Your email address is <YOUR ADDRESS>

Remove a token

$ google-oauth-cli logout

About

It is a tool to be authorized with OAuth 2.0(Authorization Code Flow with Proof Key for Code Exchange) and access Google API.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages