# README
This oauth2 folder contains a oauth2 package with a partial client OAuth2 implementation.
It has been copied over from the original for our use. A lot of the original code and dependencies have been deleted, and the rest reshuffled.
Original Project: Go OAuth2 - pkg.go.dev/golang.org/x/oauth2
- Commit hash at the time of cloning d3ed0bb246c8d3c75b63937d9a5eecff9c74d7fe
- Original Project's Repo on GitHub: golang/oauth2
- Original Project's Repo on Google Open Source: https://cs.opensource.google/go/x/oauth2
- License: BSD 3-Clause - Local copy
Note: The original authors are not aware of this fork, and do not endorse it in any way.
# Packages
Package clientcredentials implements the OAuth2.0 "client credentials" token flow, also known as the "two-legged OAuth 2.0".
# Functions
NewClient creates an *http.Client from a Context and TokenSource.
RegisterBrokenAuthHeaderProvider previously did something.
ReuseTokenSource returns a TokenSource which repeatedly returns the same token as long as it's valid, starting with t.
SetAuthURLParam builds an AuthCodeOption which passes key/value parameters to a provider's authorization endpoint.
StaticTokenSource returns a TokenSource that always returns the same token.
# Constants
AuthStyleAutoDetect means to auto-detect which authentication style the provider wants by trying both ways and caching the successful way for the future.
AuthStyleInHeader sends the client_id and client_password using HTTP Basic Authorization.
AuthStyleInParams sends the "client_id" and "client_secret" in the POST body as application/x-www-form-urlencoded parameters.
# Variables
No description provided by the author
AccessTypeOnline and AccessTypeOffline are options passed to the Options.AuthCodeURL method.
ApprovalForce forces the users to view the consent dialog and confirm the permissions request at the URL returned from AuthCodeURL, even if they've already done so.
HTTPClient is the context key to use with golang.org/x/net/context's WithValue function to associate an *http.Client value with a context.
NoContext is the default context you should supply if not using your own context.Context (see https://golang.org/x/net/context).
# Structs
Config describes a typical 3-legged OAuth2 flow, with both the client application information and the server's endpoint URLs.
Endpoint represents an OAuth 2.0 provider's authorization and token endpoint URLs.
RetrieveError is the error returned when the token endpoint returns a non-2XX HTTP status code.
Token represents the credentials used to authorize the requests to access protected resources on the OAuth 2.0 provider's backend.
Transport is an http.RoundTripper that makes OAuth 2.0 HTTP requests, wrapping a base RoundTripper and adding an Authorization header with a token from the supplied Sources.
# Interfaces
An AuthCodeOption is passed to Config.AuthCodeURL.
A TokenSource is anything that can return a token.
# Type aliases
AuthStyle represents how requests for tokens are authenticated to the server.