package oauth
Import Path
google.golang.org/grpc/credentials/oauth (on go.dev)
Dependency Relation
imports 8 packages, and imported by 2 packages
Involved Source Files
Package oauth implements gRPC credentials using OAuth.
Package-Level Type Names (total 4, in which 1 are exported)
TokenSource supplies PerRPCCredentials from an oauth2.TokenSource.
TokenSource oauth2.TokenSource
GetRequestMetadata gets the request metadata as a map from a TokenSource.
RequireTransportSecurity indicates whether the credentials requires transport security.
Token returns a token or an error.
Token must be safe for concurrent use by multiple goroutines.
The returned Token must not be modified.
T : google.golang.org/grpc/credentials.PerRPCCredentials
T : golang.org/x/oauth2.TokenSource
Package-Level Functions (total 7, all are exported)
NewApplicationDefault returns "Application Default Credentials". For more
detail, see https://developers.google.com/accounts/docs/application-default-credentials.
NewComputeEngine constructs the PerRPCCredentials that fetches access tokens from
Google Compute Engine (GCE)'s metadata server. It is only valid to use this
if your program is running on a GCE instance.
TODO(dsymonds): Deprecate and remove this.
NewJWTAccessFromFile creates PerRPCCredentials from the given keyFile.
NewJWTAccessFromKey creates PerRPCCredentials from the given jsonKey.
NewOauthAccess constructs the PerRPCCredentials using a given token.
NewServiceAccountFromFile constructs the PerRPCCredentials using the JSON key file
of a Google Developers service account.
NewServiceAccountFromKey constructs the PerRPCCredentials using the JSON key slice
from a Google Developers service account.
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |