Documentation ¶
Overview ¶
Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.
Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.
Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.
Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.
Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.
Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.
Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.
Index ¶
- func Init()
- type Authentication
- func (auth *Authentication) Auth(onsuccess http.Handler, ...) http.Handler
- func (auth *Authentication) AuthApi(onsuccess http.Handler, ...) http.Handler
- func (auth *Authentication) AuthConfigApi(onsuccess http.Handler, ...) http.Handler
- func (auth *Authentication) AuthFrontendApi(onsuccess http.Handler, ...) http.Handler
- func (auth *Authentication) AuthUserApi(onsuccess http.Handler, ...) http.Handler
- func (auth *Authentication) AuthViaSession(rw http.ResponseWriter, r *http.Request) (*schema.User, error)
- func (auth *Authentication) Login(onfailure func(rw http.ResponseWriter, r *http.Request, loginErr error)) http.Handler
- func (auth *Authentication) Logout(onsuccess http.Handler) http.Handler
- func (auth *Authentication) SaveSession(rw http.ResponseWriter, r *http.Request, user *schema.User) error
- type Authenticator
- type JWTAuthenticator
- type JWTCookieSessionAuthenticator
- func (ja *JWTCookieSessionAuthenticator) CanLogin(user *schema.User, username string, rw http.ResponseWriter, r *http.Request) (*schema.User, bool)
- func (ja *JWTCookieSessionAuthenticator) Init() error
- func (ja *JWTCookieSessionAuthenticator) Login(user *schema.User, rw http.ResponseWriter, r *http.Request) (*schema.User, error)
- type JWTSessionAuthenticator
- func (ja *JWTSessionAuthenticator) CanLogin(user *schema.User, username string, rw http.ResponseWriter, r *http.Request) (*schema.User, bool)
- func (ja *JWTSessionAuthenticator) Init() error
- func (ja *JWTSessionAuthenticator) Login(user *schema.User, rw http.ResponseWriter, r *http.Request) (*schema.User, error)
- type LdapAuthenticator
- func (la *LdapAuthenticator) CanLogin(user *schema.User, username string, rw http.ResponseWriter, r *http.Request) (*schema.User, bool)
- func (la *LdapAuthenticator) Init() error
- func (la *LdapAuthenticator) Login(user *schema.User, rw http.ResponseWriter, r *http.Request) (*schema.User, error)
- func (la *LdapAuthenticator) Sync() error
- type LocalAuthenticator
- type OIDC
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Authentication ¶
type Authentication struct { LdapAuth *LdapAuthenticator JwtAuth *JWTAuthenticator LocalAuth *LocalAuthenticator SessionMaxAge time.Duration // contains filtered or unexported fields }
func GetAuthInstance ¶ added in v1.4.0
func GetAuthInstance() *Authentication
func (*Authentication) Auth ¶
func (auth *Authentication) Auth( onsuccess http.Handler, onfailure func(rw http.ResponseWriter, r *http.Request, authErr error), ) http.Handler
func (*Authentication) AuthApi ¶ added in v1.4.0
func (auth *Authentication) AuthApi( onsuccess http.Handler, onfailure func(rw http.ResponseWriter, r *http.Request, authErr error), ) http.Handler
func (*Authentication) AuthConfigApi ¶ added in v1.4.0
func (auth *Authentication) AuthConfigApi( onsuccess http.Handler, onfailure func(rw http.ResponseWriter, r *http.Request, authErr error), ) http.Handler
func (*Authentication) AuthFrontendApi ¶ added in v1.4.0
func (auth *Authentication) AuthFrontendApi( onsuccess http.Handler, onfailure func(rw http.ResponseWriter, r *http.Request, authErr error), ) http.Handler
func (*Authentication) AuthUserApi ¶ added in v1.4.0
func (auth *Authentication) AuthUserApi( onsuccess http.Handler, onfailure func(rw http.ResponseWriter, r *http.Request, authErr error), ) http.Handler
func (*Authentication) AuthViaSession ¶
func (auth *Authentication) AuthViaSession( rw http.ResponseWriter, r *http.Request, ) (*schema.User, error)
func (*Authentication) Login ¶
func (auth *Authentication) Login( onfailure func(rw http.ResponseWriter, r *http.Request, loginErr error), ) http.Handler
func (*Authentication) Logout ¶
func (auth *Authentication) Logout(onsuccess http.Handler) http.Handler
func (*Authentication) SaveSession ¶ added in v1.3.0
func (auth *Authentication) SaveSession(rw http.ResponseWriter, r *http.Request, user *schema.User) error
type Authenticator ¶
type JWTAuthenticator ¶
type JWTAuthenticator struct {
// contains filtered or unexported fields
}
func (*JWTAuthenticator) AuthViaJWT ¶ added in v1.2.0
func (ja *JWTAuthenticator) AuthViaJWT( rw http.ResponseWriter, r *http.Request, ) (*schema.User, error)
func (*JWTAuthenticator) Init ¶
func (ja *JWTAuthenticator) Init() error
func (*JWTAuthenticator) ProvideJWT ¶
func (ja *JWTAuthenticator) ProvideJWT(user *schema.User) (string, error)
Generate a new JWT that can be used for authentication
type JWTCookieSessionAuthenticator ¶ added in v1.2.0
type JWTCookieSessionAuthenticator struct {
// contains filtered or unexported fields
}
func (*JWTCookieSessionAuthenticator) Init ¶ added in v1.2.0
func (ja *JWTCookieSessionAuthenticator) Init() error
type JWTSessionAuthenticator ¶ added in v1.2.0
type JWTSessionAuthenticator struct {
// contains filtered or unexported fields
}
func (*JWTSessionAuthenticator) Init ¶ added in v1.2.0
func (ja *JWTSessionAuthenticator) Init() error
type LdapAuthenticator ¶
type LdapAuthenticator struct { UserAttr string // contains filtered or unexported fields }
func (*LdapAuthenticator) Init ¶
func (la *LdapAuthenticator) Init() error
func (*LdapAuthenticator) Login ¶
func (la *LdapAuthenticator) Login( user *schema.User, rw http.ResponseWriter, r *http.Request, ) (*schema.User, error)
func (*LdapAuthenticator) Sync ¶
func (la *LdapAuthenticator) Sync() error
type LocalAuthenticator ¶
type LocalAuthenticator struct {
// contains filtered or unexported fields
}
func (*LocalAuthenticator) Init ¶
func (la *LocalAuthenticator) Init() error
type OIDC ¶ added in v1.3.0
type OIDC struct {
// contains filtered or unexported fields
}
func NewOIDC ¶ added in v1.3.0
func NewOIDC(a *Authentication) *OIDC
func (*OIDC) OAuth2Callback ¶ added in v1.3.0
func (oa *OIDC) OAuth2Callback(rw http.ResponseWriter, r *http.Request)
func (*OIDC) OAuth2Login ¶ added in v1.3.0
func (oa *OIDC) OAuth2Login(rw http.ResponseWriter, r *http.Request)