Documentation
¶
Overview ¶
Package google provides support for making OAuth2 authorized and authenticated HTTP requests to Google APIs. It supports Web server, client-side, service accounts, Google Compute Engine service accounts, and Google App Engine service accounts authorization and authentications flows:
For more information, please read https://developers.google.com/accounts/docs/OAuth2.
Index ¶
Examples ¶
Constants ¶
const JWTTokenURL = "https://accounts.google.com/o/oauth2/token"
JWTTokenURL is Google's OAuth 2.0 token URL to use with the JWT flow.
Variables ¶
var Endpoint = oauth2.Endpoint{
AuthURL: "https://accounts.google.com/o/oauth2/auth",
TokenURL: "https://accounts.google.com/o/oauth2/token",
}
Endpoint is Google's OAuth 2.0 endpoint.
Functions ¶
func AppEngineTokenSource ¶
func AppEngineTokenSource(ctx appengine.Context, scope ...string) oauth2.TokenSource
AppEngineTokenSource returns a token source that fetches tokens issued to the current App Engine application's service account. If you are implementing a 3-legged OAuth 2.0 flow on App Engine that involves user accounts, see oauth2.Config instead.
You are required to provide a valid appengine.Context as context.
func ComputeTokenSource ¶
func ComputeTokenSource(account string) oauth2.TokenSource
ComputeTokenSource returns a token source that fetches access tokens from Google Compute Engine (GCE)'s metadata server. It's only valid to use this token source if your program is running on a GCE instance. If no account is specified, "default" is used. Further information about retrieving access tokens from the GCE metadata server can be found at https://cloud.google.com/compute/docs/authentication.
func JWTConfigFromJSON ¶
JWTConfigFromJSON uses a Google Developers service account JSON key file to read the credentials that authorize and authenticate the requests. 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.
Types ¶
This section is empty.