openid

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupSavedOpenIDProviders added in v0.21.0

func CleanupSavedOpenIDProviders()

func HandleCallback

func HandleCallback(c echo.Context) error

HandleCallback handles the auth request callback after redirecting from the provider with an auth code @Summary Authenticate a user with OpenID Connect @Description After a redirect from the OpenID Connect provider to the frontend has been made with the authentication `code`, this endpoint can be used to obtain a jwt token for that user and thus log them in. @ID get-token-openid @tags auth @Accept json @Produce json @Security JWTKeyAuth @Param callback body openid.Callback true "The openid callback" @Param provider path int true "The OpenID Connect provider key as returned by the /info endpoint" @Success 200 {object} auth.Token @Failure 500 {object} models.Message "Internal error" @Router /auth/openid/{provider}/callback [post]

Types

type Callback

type Callback struct {
	Code        string `query:"code" json:"code"`
	Scope       string `query:"scop" json:"scope"`
	RedirectURL string `json:"redirect_url"`
}

Callback contains the callback after an auth request was made and redirected

type Provider

type Provider struct {
	Name            string `json:"name"`
	Key             string `json:"key"`
	OriginalAuthURL string `json:"-"`
	AuthURL         string `json:"auth_url"`
	LogoutURL       string `json:"logout_url"`
	ClientID        string `json:"client_id"`
	ClientSecret    string `json:"-"`

	Oauth2Config *oauth2.Config `json:"-"`
	// contains filtered or unexported fields
}

Provider is the structure of an OpenID Connect provider

func GetAllProviders

func GetAllProviders() (providers []*Provider, err error)

GetAllProviders returns all configured providers

func GetProvider

func GetProvider(key string) (provider *Provider, err error)

GetProvider retrieves a provider from keyvalue

Jump to

Keyboard shortcuts

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