go-gettokenbyserviceaccount
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
andscopes
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
Author
If you have any questions and commissions for me, feel free to tell me.
Update History
-
v1.0.0 (December 11, 2018)
- Initial release.