saml

package
v0.0.0-...-dfb39b5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2026 License: Apache-2.0 Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchIDPMetadata

func FetchIDPMetadata(ctx context.Context, u url.URL) (*saml.EntityDescriptor, error)

FetchIDPMetadata loads the idp metadata, usually the url is configured in settings

func TemplateProvider

func TemplateProvider(url, name string) templateProvider

TemplateProvider adds a wrapper to the button data that is displayed on the login form

func UpdateSettings

func UpdateSettings(source *types.AppSettings, dest *settings.Settings)

UpdateSettings applies the app settings to the auth specific settings

Types

type IdpIdentityPayload

type IdpIdentityPayload struct {
	Name       string
	Handle     string
	Identifier string
}

type SamlSPArgs

type SamlSPArgs struct {
	Enabled bool

	AcsURL  string
	MetaURL string
	SloURL  string

	SignRequests    bool
	SignatureMethod string

	Binding string

	// user meta from idp
	IdentityPayload IdpIdentityPayload

	IdpURL      url.URL
	Host        url.URL
	Certificate *x509.Certificate
	PrivateKey  *rsa.PrivateKey
	IdpMeta     *saml.EntityDescriptor
}

type SamlSPService

type SamlSPService struct {
	Enabled bool

	IdpURL      url.URL
	Host        url.URL
	IDPUserMeta *IdpIdentityPayload
	IDPMeta     *saml.EntityDescriptor
	// contains filtered or unexported fields
}

func NewSamlSPService

func NewSamlSPService(log *zap.Logger, args SamlSPArgs) (s *SamlSPService, err error)

NewSamlSPService loads the certificates and registers the already fetched IDP metadata into the SAML middleware

func (*SamlSPService) GuessIdentifier

func (ssp *SamlSPService) GuessIdentifier(payload map[string][]string) string

GuessIdentifier tries to guess the necessary (email) key for external authentication

func (*SamlSPService) Handler

func (ssp *SamlSPService) Handler() *samlsp.Middleware

func (*SamlSPService) NameIdentifier

func (ssp *SamlSPService) NameIdentifier() string

func (*SamlSPService) ServeHTTP

func (ssp *SamlSPService) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP enables us to use the service directly in the router

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL