MCPcopy Create free account
hub / github.com/golang/appengine / AccessToken

Function AccessToken

identity.go:79–88  ·  view source on GitHub ↗

AccessToken generates an OAuth2 access token for the specified scopes on behalf of service account of this application. This token will expire after the returned time.

(c context.Context, scopes ...string)

Source from the content-addressed store, hash-verified

77// behalf of service account of this application. This token will expire after
78// the returned time.
79func AccessToken(c context.Context, scopes ...string) (token string, expiry time.Time, err error) {
80 req := &pb.GetAccessTokenRequest{Scope: scopes}
81 res := &pb.GetAccessTokenResponse{}
82
83 err = internal.Call(c, "app_identity_service", "GetAccessToken", req, res)
84 if err != nil {
85 return "", time.Time{}, err
86 }
87 return res.GetAccessToken(), time.Unix(res.GetExpirationTime(), 0), nil
88}
89
90// Certificate represents a public certificate for the app.
91type Certificate struct {

Callers

nothing calls this directly

Calls 3

GetAccessTokenMethod · 0.95
GetExpirationTimeMethod · 0.95
CallFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…