oauth2x

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Issuer string
	Ctx    context.Context
	// contains filtered or unexported fields
}

Config is the configuration for an oauth2 provider, especially all relevant endpoint

func NewConfig

func NewConfig(ctx context.Context, issuer string) (*Config, error)

NewConfig creates a new Config for the passed issuer with the passed context.Context and performs the OAuth2/OpenID discovery

func (*Config) Endpoints

func (c *Config) Endpoints() (*Endpoints, error)

Endpoints returns the Endpoints for this Config

func (*Config) RevokeToken

func (c *Config) RevokeToken(oauth2Config *oauth2.Config, token string) error

RevokeToken revokes a token at the revocation endpoint This function is untested

type Endpoints

type Endpoints struct {
	Authorization string `json:"authorization_endpoint"`
	Token         string `json:"token_endpoint"`
	Userinfo      string `json:"userinfo_endpoint"`
	Registration  string `json:"registration_endpoint"`
	Revocation    string `json:"revocation_endpoint"`
	Introspection string `json:"introspection_endpoint"`
}

Endpoints holds all relevant OAuth2/OIDC endpoints

func (*Endpoints) OAuth2

func (e *Endpoints) OAuth2() oauth2.Endpoint

OAuth2 returns the endpoints as oauth2.Endpoint so it can be used with the oauth2 package

Jump to

Keyboard shortcuts

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