example

command
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2019 License: Apache-2.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

oauth2cli example

This is an example application using oauth2cli.

Getting Started

Setup your API access:

  1. Open https://console.cloud.google.com/apis/credentials
  2. Create an OAuth client ID where the application type is other.

Set the environment variables:

export GOOGLE_CLIENT_ID=xxx.apps.googleusercontent.com
export GOOGLE_CLIENT_SECRET=xxx

Run the application:

% go run main.go
2019/05/15 09:39:16 Open http://localhost:58806
2019/05/15 09:39:26 Got a token: &{AccessToken:... TokenType:Bearer RefreshToken:... scope:https://www.googleapis.com/auth/userinfo.email openid token_type:Bearer]}
2019/05/15 09:39:26 Your token is valid until 2019-05-15 10:39:26.720292 +0900 JST m=+3609.800317611

It will automatically open the browser and you can log in to Google.

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