Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseAuthorization ¶
ParseAuthorization returns the scheme and token of the Authorization string if it's valid.
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
Auth defines a structure which allows us properly retrieve oauth authentication data from the OAuth2 api.
func New ¶
func New(cred Credential, endpoints oauth2.Endpoint, redirectURL string) *Auth
New returns a new instance of OAuth.
func (*Auth) AuthorizeFromUser ¶
AuthorizeFromUser takes the code retrieved from the users login process and attempts to retrieve a access token from the configuration.
type Credential ¶
type Credential struct { ClientID string `json:"client_id"` ClientSecret string `json:"client_secret"` Scopes []string `json:"scopes"` }
Credential defines a struct which holds clientID and clientSecret which are used by oauths.
Click to show internal directories.
Click to hide internal directories.