You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

44 lines
2.1 KiB

  1. // Copyright 2018 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // +build !go1.9
  5. // Package google provides support for making OAuth2 authorized and authenticated
  6. // HTTP requests to Google APIs. It supports the Web server flow, client-side
  7. // credentials, service accounts, Google Compute Engine service accounts, and Google
  8. // App Engine service accounts.
  9. //
  10. // A brief overview of the package follows. For more information, please read
  11. // https://developers.google.com/accounts/docs/OAuth2
  12. // and
  13. // https://developers.google.com/accounts/docs/application-default-credentials.
  14. //
  15. // OAuth2 Configs
  16. //
  17. // Two functions in this package return golang.org/x/oauth2.Config values from Google credential
  18. // data. Google supports two JSON formats for OAuth2 credentials: one is handled by ConfigFromJSON,
  19. // the other by JWTConfigFromJSON. The returned Config can be used to obtain a TokenSource or
  20. // create an http.Client.
  21. //
  22. //
  23. // Credentials
  24. //
  25. // The DefaultCredentials type represents Google Application Default Credentials, as
  26. // well as other forms of credential.
  27. //
  28. // Use FindDefaultCredentials to obtain Application Default Credentials.
  29. // FindDefaultCredentials looks in some well-known places for a credentials file, and
  30. // will call AppEngineTokenSource or ComputeTokenSource as needed.
  31. //
  32. // DefaultClient and DefaultTokenSource are convenience methods. They first call FindDefaultCredentials,
  33. // then use the credentials to construct an http.Client or an oauth2.TokenSource.
  34. //
  35. // Use CredentialsFromJSON to obtain credentials from either of the two JSON
  36. // formats described in OAuth2 Configs, above. (The DefaultCredentials returned may
  37. // not be "Application Default Credentials".) The TokenSource in the returned value
  38. // is the same as the one obtained from the oauth2.Config returned from
  39. // ConfigFromJSON or JWTConfigFromJSON, but the DefaultCredentials may contain
  40. // additional information that is useful is some circumstances.
  41. package google // import "golang.org/x/oauth2/google"