google-oauth-cli

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

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

Go to latest
Published: Jul 7, 2022 License: MIT Imports: 16 Imported by: 0

README

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

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