Versions in this module Expand all Collapse all v0 v0.14.0 Apr 24, 2024 v0.13.0 Feb 27, 2024 Changes in this version + var ErrSamlSloRequired = security.NewAuthenticationError("SAML SLO required") + var FeatureId = security.FeatureId("saml_login", security.FeatureOrderSamlLogin) + var LogoutFeatureId = security.FeatureId("saml_logout", security.FeatureOrderSamlLogout) + var Module = &bootstrap.Module + var SupportedBindings = utils.NewStringSet(saml.HTTPRedirectBinding, saml.HTTPPostBinding) + func NewTrackedRequestSuccessHandler(tracker samlsp.RequestTracker) security.AuthenticationSuccessHandler + func Use() + type AssertionCandidate struct + Assertion *saml.Assertion + DetailsMap map[string]interface{} + func (a *AssertionCandidate) Credentials() interface{} + func (a *AssertionCandidate) Details() interface{} + func (a *AssertionCandidate) Principal() interface{} + type Authenticator struct + func (a *Authenticator) Authenticate(ctx context.Context, candidate security.Candidate) (security.Authentication, error) + type CacheableIdpClientManager struct + func NewCacheableIdpClientManager(template saml.ServiceProvider) *CacheableIdpClientManager + func (m *CacheableIdpClientManager) GetAllClients() []*saml.ServiceProvider + func (m *CacheableIdpClientManager) GetClientByComparator(comparator func(details samlctx.SamlIdentityProvider) bool) (client *saml.ServiceProvider, ok bool) + func (m *CacheableIdpClientManager) GetClientByDomain(domain string) (client *saml.ServiceProvider, ok bool) + func (m *CacheableIdpClientManager) GetClientByEntityId(entityId string) (client *saml.ServiceProvider, ok bool) + func (m *CacheableIdpClientManager) RefreshCache(ctx context.Context, identityProviders []samlctx.SamlIdentityProvider) + type CookieRequestTracker struct + Codec samlsp.TrackedRequestCodec + MaxAge time.Duration + NamePrefix string + Path string + SameSite http.SameSite + Secure bool + func (t CookieRequestTracker) GetTrackedRequest(r *http.Request, index string) (*samlsp.TrackedRequest, error) + func (t CookieRequestTracker) GetTrackedRequests(r *http.Request) []samlsp.TrackedRequest + func (t CookieRequestTracker) StopTrackingRequest(w http.ResponseWriter, r *http.Request, index string) error + func (t CookieRequestTracker) TrackRequest(w http.ResponseWriter, r *http.Request, samlRequestID string) (string, error) + type Feature struct + func New() *Feature + func NewLogout() *Feature + func (f *Feature) ErrorPath(path string) *Feature + func (f *Feature) Identifier() security.FeatureIdentifier + func (f *Feature) Issuer(issuer security.Issuer) *Feature + type SLOState int + const SLOCompleted + const SLOCompletedFully + const SLOCompletedPartially + const SLOFailed + const SLOInitiated + func (s SLOState) Is(mask SLOState) bool + type SPLoginMiddleware struct + func NewLoginMiddleware(sp saml.ServiceProvider, tracker samlsp.RequestTracker, ...) *SPLoginMiddleware + func (sp *SPLoginMiddleware) ACSHandlerFunc() gin.HandlerFunc + func (sp *SPLoginMiddleware) Commence(c context.Context, r *http.Request, w http.ResponseWriter, _ error) + func (sp *SPLoginMiddleware) MakeAuthenticationRequest(ctx context.Context, r *http.Request, w http.ResponseWriter) error + type SPLogoutMiddleware struct + func NewLogoutMiddleware(sp saml.ServiceProvider, idpManager idp.IdentityProviderManager, ...) *SPLogoutMiddleware + func (m *SPLogoutMiddleware) Commence(ctx context.Context, r *http.Request, w http.ResponseWriter, err error) + func (m *SPLogoutMiddleware) LogoutHandlerFunc() gin.HandlerFunc + func (m *SPLogoutMiddleware) MakeSingleLogoutRequest(ctx context.Context, r *http.Request, w http.ResponseWriter) error + type SPMetadataMiddleware struct + func (m *SPMetadataMiddleware) MetadataHandlerFunc() gin.HandlerFunc + func (m *SPMetadataMiddleware) RefreshMetadataHandler() gin.HandlerFunc + type SPOptions struct + AllowIDPInitiated bool + Certificate *x509.Certificate + ForceAuthn bool + Intermediates []*x509.Certificate + Key *rsa.PrivateKey + NameIdFormat string + SignRequest bool + type SamlAssertionAuthentication interface + Assertion func() *saml.Assertion + type SamlAuthConfigurer struct + func (c *SamlAuthConfigurer) Apply(feature security.Feature, ws security.WebSecurity) error + type SamlLogoutConfigurer struct + func (c *SamlLogoutConfigurer) Apply(feature security.Feature, ws security.WebSecurity) error + type SingleLogoutHandler struct + func NewSingleLogoutHandler() *SingleLogoutHandler + func (h *SingleLogoutHandler) HandleLogout(ctx context.Context, _ *http.Request, _ http.ResponseWriter, ...) error + func (h *SingleLogoutHandler) ShouldLogout(ctx context.Context, _ *http.Request, _ http.ResponseWriter, ...) error + type TrackedRequestSuccessHandler struct + func (t *TrackedRequestSuccessHandler) HandleAuthenticationSuccess(c context.Context, r *http.Request, rw http.ResponseWriter, ...)