| Issue 3373: | JWTConfigFromJSON method with imersonate feature | |
| 1 person starred this issue and may be notified of changes. | Back to list |
Please consider adding this method to impersonate a user from a service account // JWTConfigFromJSONWithImpersonate uses a Google Developers service account JSON key file to read // the credentials that authorize and authenticate the requests with the ability to impersonate a user. // Create a service account on "Credentials" page under "APIs & Auth" for your // project at https://console.developers.google.com to download a JSON key file. func JWTConfigFromJSONWithImpersonate(jsonKey []byte, usersEmail string, scope ...string) (*jwt.Config, error) { var key struct { Email string `json:"client_email"` PrivateKey string `json:"private_key"` } if err := json.Unmarshal(jsonKey, &key); err != nil { return nil, err } return &jwt.Config{ Email: key.Email, PrivateKey: []byte(key.PrivateKey), Subject: usersEmail, Scopes: scope, TokenURL: JWTTokenURL, }, nil }
May 18, 2015
Project Member
#1
david.pu...@sonymobile.com
Status:
Invalid
|
|
| ► Sign in to add a comment |