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 ¶
GetAllProviders returns all configured providers
func GetProvider ¶
GetProvider retrieves a provider from keyvalue