xoauth2

package
v0.0.0-...-891d2fd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 18, 2022 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// TokenKey is the key under which an oAuth Token is stored in a context
	TokenKey tokenkey
)

Functions

func NewRequest

NewRequest returns a new user Authentifier object that handles a http request for user authentication.

Types

type Authentifier

type Authentifier struct {
	Session session.Handler
	*oauth2.Config
	Options []oauth2.AuthCodeOption
	Log     *log.Logger
}

Authentifier defines a http request handler that will initiate the oAuth request.

func (Authentifier) AuthCodeOptions

func (l Authentifier) AuthCodeOptions(opt ...oauth2.AuthCodeOption) Authentifier

AuthCodeOptions allows to add some options that will parameterize the login request. By default, nothing is passed which means that no refresh token is requested.

func (Authentifier) ServeHTTP

func (l Authentifier) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP handles the request.

type CallbackHandler

type CallbackHandler struct {
	// contains filtered or unexported fields
}

CallbackHandler defines a http request handler that will deal with the finalization of the oAuth request by saving the authorization token in the session store and the context object and executing either user Authentication (aka user signin) or user Registration (aka user signup).

Link enables the linking of a xhttp.Handler to the CallbackHandler.

func (CallbackHandler) ServeHTTP

func (c CallbackHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP handles the request.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL