Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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. @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"` }
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"` 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