Documentation ¶
Index ¶
- func AssignOrCreateUserToTeams(s *xorm.Session, u *user.User, teamData []*models.OIDCTeam, issuer string) (oidcTeams []int64, err error)
- func CleanupSavedOpenIDProviders()
- func CreateOIDCTeam(s *xorm.Session, teamData *models.OIDCTeam, u *user.User, issuer string) (team *models.Team, err error)
- func GetOrCreateTeamsByOIDC(s *xorm.Session, teamData []*models.OIDCTeam, u *user.User, issuer string) (te []*models.Team, err error)
- func HandleCallback(c echo.Context) error
- func RegisterEmptyOpenIDTeamCleanupCron()
- func RemoveEmptySSOTeams(s *xorm.Session) (err error)
- func RemoveUserFromTeamsByIDs(s *xorm.Session, u *user.User, teamIDs []int64) (err error)
- type Callback
- type Provider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssignOrCreateUserToTeams ¶ added in v0.24.0
func CleanupSavedOpenIDProviders ¶ added in v0.21.0
func CleanupSavedOpenIDProviders()
func CreateOIDCTeam ¶ added in v0.24.0
func GetOrCreateTeamsByOIDC ¶ added in v0.24.0
func GetOrCreateTeamsByOIDC(s *xorm.Session, teamData []*models.OIDCTeam, u *user.User, issuer string) (te []*models.Team, err error)
GetOrCreateTeamsByOIDC returns a slice of teams which were generated from the oidc data. If a team did not exist previously it is automatically created.
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]
func RegisterEmptyOpenIDTeamCleanupCron ¶ added in v0.24.0
func RegisterEmptyOpenIDTeamCleanupCron()
func RemoveEmptySSOTeams ¶ added in v0.24.0
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"` Scope string `json:"scope"` 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