oauth2

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallbackHookConstructor

type CallbackHookConstructor func(ctx context.Context, token *oauth2.Token, w http.ResponseWriter, r *http.Request)

type O2CBuilderConstructor

type O2CBuilderConstructor func(ctx context.Context, req *http.Request) (*oauth2.Config, error)

type OIDC

type OIDC struct {
	sync.Map
	Oauth2
	// contains filtered or unexported fields
}

func NewOIDC

func NewOIDC(cfg *OidcConfig) *OIDC

func (*OIDC) Oauth2Cfg

func (s *OIDC) Oauth2Cfg(ctx context.Context, req *http.Request) (*oauth2.Config, error)

func (*OIDC) SetupIDTokenHook

func (s *OIDC) SetupIDTokenHook(hook func(ctx context.Context, token string) http.HandlerFunc)

func (*OIDC) SetupUserInfoHook

func (s *OIDC) SetupUserInfoHook(hook func(ctx context.Context, userInfo *oidc.UserInfo) error)

func (*OIDC) VerifyIDToken

func (s *OIDC) VerifyIDToken(ctx context.Context, rawIDToken string) (*oidc.IDToken, error)

type Oauth2

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

func (*Oauth2) SetCallbackHook

func (s *Oauth2) SetCallbackHook(callbackHook CallbackHookConstructor)

func (*Oauth2) SetOauth2ConfigBuilder

func (s *Oauth2) SetOauth2ConfigBuilder(buildOauth2Config O2CBuilderConstructor)

func (*Oauth2) Setup

func (s *Oauth2) Setup(handleFunc func(path string, h http.HandlerFunc))

type OidcConfig

type OidcConfig struct {
	Issuer       string `yaml:"issuer"`
	ClientID     string `yaml:"client_id"`
	ClientSecret string `yaml:"client_secret"`
}

Jump to

Keyboard shortcuts

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