kenfoo / go-gettokenbyserviceaccount

This is a Golang library to retrieve access token from Service Account of Google without using Google's OAuth2 package.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

go-gettokenbyserviceaccount

Build Status MIT License

Overview

This is a Golang library to retrieve access token from Service Account of Google without using Google's OAuth2 package.

Install

You can install this using go get as follows.

$ go get -u github.com/tanaikech/go-gettokenbyserviceaccount

Usage

res, err := gettokenbyserviceaccount.Do(privateKey, clientEmail, scopes)
  • privateKey, clientEmail and scopes are string values.

You can obtain the access token like below.

{
  "access_token": "#####",
  "expires_in": 3600,
  "token_type": "Bearer",
  "start_time": 1234567890,
  "end_time": 1234567890
}

You can also retrieve this result using Google's OAuth2 package. I created this library to study the JWT process.


Licence

MIT

Author

Tanaike

If you have any questions and commissions for me, feel free to tell me.

Update History

  • v1.0.0 (December 11, 2018)

    1. Initial release.

TOP

About

This is a Golang library to retrieve access token from Service Account of Google without using Google's OAuth2 package.

License:MIT License


Languages

Language:Go 100.0%