oidc

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScopeOIDC    = "openid"
	ScopeProfile = "profile"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Config
}

func New

func New(c Config) (*API, error)

func (API) JWKs

func (a API) JWKs(c echo.Context) error

func (API) Logout

func (a API) Logout(c echo.Context) error

func (API) Register

func (a API) Register(app *echo.Echo) error

func (API) Token

func (a API) Token(c echo.Context) error

func (API) UserInfo

func (a API) UserInfo(c echo.Context) error

type AccessTknClaims

type AccessTknClaims struct {
	jwt.RegisteredClaims
	UserID string   `json:"user_id"`
	Scopes []string `json:"scopes"`
}

type Config

type Config struct {
	DB        *sqlc.Queries
	Key       conf.Key
	Providers conf.Providers
	BaseURL   string
	FS        fs.Storage
}

type IDTknClaims

type IDTknClaims struct {
	jwt.RegisteredClaims
	SID string `json:"sid"`
}

type JWK

type JWK struct {
	Kty string `json:"kty"`
	Kid string `json:"kid"`
	Alg string `json:"alg"`
	Use string `json:"use"`
	Crv string `json:"crv"`
	X   string `json:"x"`
}

type Keys

type Keys struct {
	JWKs []JWK `json:"keys"`
}

type LogoutParams

type LogoutParams struct {
	IDTkn       string `query:"id_token_hint"`
	SID         string `query:"logout_hint"`
	RedirectURI string `query:"post_logout_redirect_uri"`
	ClientID    string `query:"client_id"`
	State       string `query:"state"`
}

type LogoutTknClaims

type LogoutTknClaims struct {
	jwt.RegisteredClaims
	Events map[string]struct{} `json:"events"`
	SID    string              `json:"sid"`
}

type UserInfo

type UserInfo struct {
	Err       string `json:"error,omitempty"`
	ErrDesc   string `json:"error_description,omitempty"`
	Email     string `json:"email,omitempty"`
	AvatarURL string `json:"avatar_url,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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