This is a sample golang script for retrieving access token using Service Account of Google by Google's OAuth2 package.
The script without using Google's OAuth2 package is here.
package main
import (
"encoding/json"
This is a sample golang script for retrieving access token using Service Account of Google by Google's OAuth2 package.
The script without using Google's OAuth2 package is here.
package main
import (
"encoding/json"
| buf, bodyErr := ioutil.ReadAll(r.Body) | |
| if bodyErr != nil { | |
| log.Print("bodyErr ", bodyErr.Error()) | |
| http.Error(w, bodyErr.Error(), http.StatusInternalServerError) | |
| return | |
| } | |
| rdr1 := ioutil.NopCloser(bytes.NewBuffer(buf)) | |
| rdr2 := ioutil.NopCloser(bytes.NewBuffer(buf)) | |
| log.Printf("BODY: %q", rdr1) |
Go to this link https://plus.google.com/me. The me part of the URL will be replaced by your Google user ID (a.k.a Google account ID)