Documentation ¶
Index ¶
- type Identity
- type IdentityTypeChecker
- type RequestIdentifier
- type RequestIdentifierFactory
- type WebAuthenticater
- type WebCallbacker
- type WebIdentityService
- func (s *WebIdentityService) Authenticate(ctx context.Context, request *web.Request) (string, web.Result)
- func (s *WebIdentityService) AuthenticateFor(ctx context.Context, broker string, request *web.Request) web.Result
- func (s *WebIdentityService) Identify(ctx context.Context, request *web.Request) Identity
- func (s *WebIdentityService) IdentifyAll(ctx context.Context, request *web.Request) []Identity
- func (s *WebIdentityService) IdentifyAs(ctx context.Context, request *web.Request, checkType IdentityTypeChecker) (Identity, error)
- func (s *WebIdentityService) IdentifyFor(ctx context.Context, broker string, request *web.Request) (Identity, error)
- func (s *WebIdentityService) Inject(identityProviders []RequestIdentifier, reverseRouter web.ReverseRouter, ...) *WebIdentityService
- func (s *WebIdentityService) Logout(ctx context.Context, request *web.Request, postLogoutRedirect *url.URL) web.Result
- func (s *WebIdentityService) LogoutFor(ctx context.Context, broker string, request *web.Request, ...) web.Result
- func (s *WebIdentityService) RequestIdentifier(broker string) RequestIdentifier
- type WebLoginEvent
- type WebLogoutEvent
- type WebLogoutWithRedirect
- type WebLogouter
- type WebModule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Identity ¶
Identity donates an authentication object which at least identifies the authenticated subject
type IdentityTypeChecker ¶ added in v3.2.1
IdentityTypeChecker for type asserting an Identity
type RequestIdentifier ¶
type RequestIdentifier interface { Broker() string Identify(ctx context.Context, request *web.Request) (Identity, error) }
RequestIdentifier identifies an request and returns a matching identity
type RequestIdentifierFactory ¶
type RequestIdentifierFactory func(config config.Map) (RequestIdentifier, error)
RequestIdentifierFactory creates RequestIdentifier
type WebAuthenticater ¶
type WebAuthenticater interface {
Authenticate(ctx context.Context, request *web.Request) web.Result
}
WebAuthenticater allows to request an authentication
type WebCallbacker ¶
type WebCallbacker interface {
Callback(ctx context.Context, request *web.Request, returnTo func(*web.Request) *url.URL) web.Result
}
WebCallbacker is called for callbacks to that identity broker
type WebIdentityService ¶
type WebIdentityService struct {
// contains filtered or unexported fields
}
WebIdentityService calls one or more identifier to get all possible identities of a user
func (*WebIdentityService) Authenticate ¶
func (s *WebIdentityService) Authenticate(ctx context.Context, request *web.Request) (string, web.Result)
Authenticate finds the first available (enforced) authentication result
func (*WebIdentityService) AuthenticateFor ¶
func (s *WebIdentityService) AuthenticateFor(ctx context.Context, broker string, request *web.Request) web.Result
AuthenticateFor starts the authentication for a given broker
func (*WebIdentityService) IdentifyAll ¶
IdentifyAll collects all possible user identites, in case multiple are available
func (*WebIdentityService) IdentifyAs ¶ added in v3.2.1
func (s *WebIdentityService) IdentifyAs(ctx context.Context, request *web.Request, checkType IdentityTypeChecker) (Identity, error)
IdentifyAs returns an identity for a given interface identity, err := s.IdentifyAs(ctx, request, OpenIDTypeChecker) identity.(oauth.OpenIDIdentity)
func (*WebIdentityService) IdentifyFor ¶
func (s *WebIdentityService) IdentifyFor(ctx context.Context, broker string, request *web.Request) (Identity, error)
IdentifyFor the user with a given broker
func (*WebIdentityService) Inject ¶
func (s *WebIdentityService) Inject( identityProviders []RequestIdentifier, reverseRouter web.ReverseRouter, eventRouter flamingo.EventRouter, responder *web.Responder, ) *WebIdentityService
Inject dependencies
func (*WebIdentityService) Logout ¶
func (s *WebIdentityService) Logout(ctx context.Context, request *web.Request, postLogoutRedirect *url.URL) web.Result
Logout logs all user out
func (*WebIdentityService) LogoutFor ¶
func (s *WebIdentityService) LogoutFor(ctx context.Context, broker string, request *web.Request, postLogoutRedirect *url.URL) web.Result
LogoutFor logs a specific broker out
func (*WebIdentityService) RequestIdentifier ¶
func (s *WebIdentityService) RequestIdentifier(broker string) RequestIdentifier
RequestIdentifier returns the given request identifier
type WebLoginEvent ¶
WebLoginEvent for the current request
type WebLogoutEvent ¶
WebLogoutEvent for the current request
type WebLogoutWithRedirect ¶
WebLogoutWithRedirect logs user out and redirects to an sso logout endpoint
type WebLogouter ¶
WebLogouter logs user out