Documentation
¶
Overview ¶
Package samlprovider provides SAML 2.0 Identity Provider capabilities (reserved module).
Index ¶
Constants ¶
View Source
const PluginID = "saml_provider"
Variables ¶
View Source
var ( ErrSPNotFound = errors.New("samlprovider: service provider not found") ErrInvalidSP = errors.New("samlprovider: invalid service provider") ErrInvalidUser = errors.New("samlprovider: user is required") ErrKeyNotConfigured = errors.New("samlprovider: private key or certificate not configured") )
Functions ¶
func BuildSAMLResponseXML ¶
func BuildSAMLResponseXML(idpEntityID string, sp *ServiceProvider, u *user.User, inResponseTo string, now time.Time, key *rsa.PrivateKey, certBase64 string) (string, error)
BuildSAMLResponseXML creates a valid SAML 2.0 Response XML document containing an authentication assertion.
Types ¶
type Config ¶
type Config struct {
EntityID string
SSOURL string
PrivateKey *rsa.PrivateKey
Certificate string // base64 DER
}
type Option ¶
type Option func(*Config)
func WithEntityID ¶
func WithSSOURL ¶
func WithSigningKey ¶
func WithSigningKey(pk *rsa.PrivateKey, certBase64 string) Option
type SAMLProvider ¶
type ServiceProvider ¶
type ServiceProvider struct {
EntityID string `json:"entity_id"`
ACSURL string `json:"acs_url"`
Certificate string `json:"certificate,omitempty"`
}
ServiceProvider represents an external SAML SP relying party.
Click to show internal directories.
Click to hide internal directories.