oauth2go

package module
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: GPL-3.0 Imports: 22 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientCredential

type ClientCredential struct {
	Config      *clientcredentials.Config
	AccessToken *oauth2.Token
}

func (*ClientCredential) Client

func (x *ClientCredential) Client(context context.Context) *http.Client

func (*ClientCredential) Token

func (x *ClientCredential) Token() (*oauth2.Token, error)

type ITokenHost

type ITokenHost interface {
	TokenRequestHandler(ctx *fasthttp.RequestCtx)
	AuthorizeRequestHandler(ctx *fasthttp.RequestCtx)
	EndSessionRequestHandler(ctx *fasthttp.RequestCtx)
	ClearTokenRequestHandler(ctx *fasthttp.RequestCtx)
}

type TokenHost

type TokenHost struct {
	AuthCookieName         string
	AuthorizeEndpoint      string
	TokenEndpoint          string
	EndSessionEndpoint     string
	LoginEndpoint          string
	LogoutEndpoint         string
	PkceRequired           bool
	PrivateKey             *rsa.PrivateKey
	ClientStore            store.IClientStore
	TokenStore             store.ITokenStore
	AuthorizationCodeStore store.IAuthorizationCodeStore
	StateStore             store.IStateStore
	ClientValidator        security.IClientValidator
	PkceValidator          security.IPkceValidator
	ResourceOwnerValidator security.IResourceOwnerValidator
	AuthCodeGenerator      token.IAuthCodeGenerator
	TokenGenerator         token.ITokenGenerator
	ClaimsGenerator        token.ITokenClaimsGenerator
	CookieEncryptor        ssecurity.ICookieEncryptor
}

func (*TokenHost) AuthorizationCodeRequestHandler

func (x *TokenHost) AuthorizationCodeRequestHandler(ctx *fasthttp.RequestCtx, client model.IClient, respType, scopesStr, redirectURI, state, username string)

AuthorizationCodeRequestHandler handle authorize code request

func (*TokenHost) AuthorizeRequestHandler

func (x *TokenHost) AuthorizeRequestHandler(ctx *fasthttp.RequestCtx)

AuthorizeRequestHandler handle authorize request

func (*TokenHost) BuildTokenHost

func (x *TokenHost) BuildTokenHost()

func (*TokenHost) ClearTokenRequestHandler

func (x *TokenHost) ClearTokenRequestHandler(ctx *fasthttp.RequestCtx)

ClearTokenHandler handle clear token request

func (*TokenHost) EndSessionRequestHandler

func (x *TokenHost) EndSessionRequestHandler(ctx *fasthttp.RequestCtx)

EndSessionRequestHandler handle end session request

func (*TokenHost) GetAuthCookieName

func (x *TokenHost) GetAuthCookieName() string

func (*TokenHost) GetAuthorizeEndpoint

func (x *TokenHost) GetAuthorizeEndpoint() string

func (*TokenHost) GetEndSessionEndpoint

func (x *TokenHost) GetEndSessionEndpoint() string

func (*TokenHost) GetLoginEndpoint

func (x *TokenHost) GetLoginEndpoint() string

func (*TokenHost) GetLogoutEndpoint

func (x *TokenHost) GetLogoutEndpoint() string

func (*TokenHost) GetPrivateKey

func (x *TokenHost) GetPrivateKey() *rsa.PrivateKey

func (*TokenHost) GetTokenEndpoint

func (x *TokenHost) GetTokenEndpoint() string

func (*TokenHost) ImplicitTokenRequestHandler

func (x *TokenHost) ImplicitTokenRequestHandler(ctx *fasthttp.RequestCtx, client model.IClient, respType, scopesStr, redirectURI, state, username string)

AuthorizationCodeRequestHandler handle implicit token request

func (*TokenHost) TokenRequestHandler

func (x *TokenHost) TokenRequestHandler(ctx *fasthttp.RequestCtx)

TokenRequestHandler handle token request

type TokenHostOption

type TokenHostOption func(*TokenHost)

Directories

Path Synopsis
rsa

Jump to

Keyboard shortcuts

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