Documentation
¶
Overview ¶
Package sp provides tools for buildin an SP such as serving metadata, authenticating an assertion and building assertions for IdPs.
Index ¶
- Constants
- Variables
- func IsSecurityException(err error, opts *SecurityOpts) bool
- func ParseCacheDuration(value string) (time.Duration, error)
- type Assertion
- type Attribute
- type AttributeStatement
- type AttributeValue
- type AttributesMap
- type Audience
- type AudienceRestriction
- type Authenticator
- type AuthnContext
- type AuthnContextClassRef
- type AuthnRequest
- type AuthnStatement
- type CacheDuration
- type Conditions
- type EncryptedAssertion
- type EncryptionMethod
- type Endpoint
- type EntitiesDescriptor
- type IDPSSODescriptor
- type IdentityProvider
- func (idp *IdentityProvider) Cert() (*pem.Block, error)
- func (idp *IdentityProvider) GenerateResponse(samlRequest, relayState string, sess *Session, address string) ([]byte, error)
- func (idp *IdentityProvider) GetSPCertFile() (string, error)
- func (idp *IdentityProvider) GetSPMetadata() (*Metadata, error)
- func (idp *IdentityProvider) Metadata() (*Metadata, error)
- func (idp *IdentityProvider) MetadataHandler(w http.ResponseWriter, r *http.Request)
- func (idp *IdentityProvider) NewLoginRequest(spMetadataURL string, authFn Authenticator) (*LoginRequest, error)
- func (idp *IdentityProvider) PrivkeyFile() (string, error)
- func (idp *IdentityProvider) PubkeyFile() (string, error)
- type IdpAuthnRequest
- type IndexedEndpoint
- type Issuer
- type KeyDescriptor
- type KeyInfo
- type LoginRequest
- type Metadata
- type NameID
- type NameIDPolicy
- type Response
- type SPSSODescriptor
- type SecurityOpts
- type ServiceProvider
- func (sp *ServiceProvider) AssertResponse(base64Res string) (*Assertion, error)
- func (sp *ServiceProvider) AuthnRequestURL(relayState string) (string, error)
- func (sp *ServiceProvider) Cert() (*pem.Block, error)
- func (sp *ServiceProvider) GetIdPCertFile() (string, error)
- func (sp *ServiceProvider) Metadata() (*Metadata, error)
- func (sp *ServiceProvider) MetadataXML() ([]byte, error)
- func (sp *ServiceProvider) NewAuthnRequest() (*AuthnRequest, error)
- func (sp *ServiceProvider) NewPostSAMLRequest() (string, error)
- func (sp *ServiceProvider) NewRedirectSAMLRequest() (string, error)
- func (sp *ServiceProvider) ParseIdPMetadata() (*Metadata, error)
- func (sp *ServiceProvider) PrivkeyFile() (string, error)
- func (sp *ServiceProvider) PubkeyFile() (string, error)
- type Session
- type Status
- type StatusCode
- type Subject
- type SubjectConfirmation
- type SubjectConfirmationData
- type SubjectLocality
Constants ¶
const HTTPPostBinding = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
HTTPPostBinding is the official URN for the HTTP-POST binding (transport)
const HTTPRedirectBinding = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
HTTPRedirectBinding is the official URN for the HTTP-Redirect binding (transport)
const IssueLifetime = time.Second * 90
IssueLifetime is the maximum timeframe where an assertion can be considered valid by the receptor.
Variables ¶
var ClockDriftTolerance = time.Duration(0)
ClockDriftTolerance is added or substracted to the current time to give some tolerance to assertion's NotBefore and NotOnOrAfter
NewID is a function that returns a unique identifier. This value can be overwritten during tests.
var Now = time.Now
Now is a function that returns the current time. This value can be overwritten during tests.
var StatusSuccess = "urn:oasis:names:tc:SAML:2.0:status:Success"
StatusSuccess is the value of a StatusCode element when the authentication succeeds. (nominally a constant, except for testing)
var WorkDir = "/tmp"
WorkDir is a temporary directory for files. We need to write keys to disk in order for xmlsec1 to pick them and use them.
Functions ¶
func IsSecurityException ¶
func IsSecurityException(err error, opts *SecurityOpts) bool
IsSecurityException returns whether the given error is a security exception not bypassed by SecurityOpts.
func ParseCacheDuration ¶ added in v0.10.0
ParseCacheDuration reads a xsd:duration from the metadata payload and converts into a time.Duration
Types ¶
type Assertion ¶
type Assertion struct {
XMLName xml.Name `xml:"urn:oasis:names:tc:SAML:2.0:assertion Assertion"`
ID string `xml:",attr"`
IssueInstant time.Time `xml:",attr"`
Version string `xml:",attr"`
Issuer *Issuer `xml:"urn:oasis:names:tc:SAML:2.0:assertion Issuer"`
Signature *xmlsec.Signature
Subject *Subject
Conditions *Conditions
AuthnStatement *AuthnStatement
AttributeStatement *AttributeStatement
}
Assertion represents the SAML object of the same name.
See http://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf
type Attribute ¶
type Attribute struct {
FriendlyName string `xml:",attr"`
Name string `xml:",attr"`
NameFormat string `xml:",attr"`
Values []AttributeValue `xml:"AttributeValue"`
}
Attribute represents the SAML object of the same name.
See http://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf
type AttributeStatement ¶
type AttributeStatement struct {
Attributes []Attribute `xml:"Attribute"`
}
AttributeStatement represents the SAML object of the same name.
See http://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf
type AttributeValue ¶
type AttributeValue struct {
Type string `xml:"http://www.w3.org/2001/XMLSchema-instance type,attr"`
Value string `xml:",chardata"`
NameID *NameID
}
AttributeValue represents the SAML object of the same name.
See http://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf
type AttributesMap ¶
AttributesMap is a type that provides methods for working with SAML attributes.
func NewAttributesMap ¶
func NewAttributesMap(assertion *Assertion) *AttributesMap
NewAttributesMap creates an attribute map given a third party assertion.
func (*AttributesMap) Get ¶
func (a *AttributesMap) Get(name string) string
Get returns the first value of the given attribute, if any.
type Audience ¶
type Audience struct {
Value string `xml:",chardata"`
}
Audience represents the SAML object of the same name.
See http://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf
type AudienceRestriction ¶
type AudienceRestriction struct {
Audience *Audience
}
AudienceRestriction represents the SAML object of the same name.
See http://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf
type Authenticator ¶ added in v0.9.8
Authenticator defines an authentication function that returns a *saml.Session value.
type AuthnContext ¶
type AuthnContext struct {
AuthnContextClassRef *AuthnContextClassRef
}
AuthnContext represents the SAML object of the same name.
See http://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf
type AuthnContextClassRef ¶
type AuthnContextClassRef struct {
Value string `xml:",chardata"`
}
AuthnContextClassRef represents the SAML object of the same name.
See http://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf
type AuthnRequest ¶
type AuthnRequest struct {
XMLName xml.Name `xml:"urn:oasis:names:tc:SAML:2.0:protocol AuthnRequest"`
AssertionConsumerServiceURL string `xml:",attr"`
Destination string `xml:",attr"`
ID string `xml:",attr"`
IssueInstant time.Time `xml:",attr"`
ProtocolBinding string `xml:",attr"`
Version string `xml:",attr"`
Issuer Issuer `xml:"urn:oasis:names:tc:SAML:2.0:assertion Issuer"`
Signature *xmlsec.Signature `xml:"http://www.w3.org/2000/09/xmldsig# Signature"`
NameIDPolicy NameIDPolicy `xml:"urn:oasis:names:tc:SAML:2.0:protocol NameIDPolicy"`
}
AuthnRequest represents the SAML object of the same name, a request from a service provider to authenticate a user.
See http://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf
type AuthnStatement ¶
type AuthnStatement struct {
AuthnInstant time.Time `xml:",attr"`
SessionIndex string `xml:",attr"`
SubjectLocality SubjectLocality
AuthnContext AuthnContext
}
AuthnStatement represents the SAML object of the same name.
See http://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf
type CacheDuration ¶ added in v0.10.0
type CacheDuration struct {
// contains filtered or unexported fields
}
func (*CacheDuration) Duration ¶ added in v0.10.0
func (duration *CacheDuration) Duration() time.Duration
func (*CacheDuration) MarshalAttr ¶ added in v0.10.0
func (*CacheDuration) UnmarshalXMLAttr ¶ added in v0.10.0
func (duration *CacheDuration) UnmarshalXMLAttr(attr xml.Attr) error
type Conditions ¶
type Conditions struct {
NotBefore time.Time `xml:",attr"`
NotOnOrAfter time.Time `xml:",attr"`
AudienceRestriction *AudienceRestriction
}
Conditions represents the SAML object of the same name.
See http://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf
type EncryptedAssertion ¶
EncryptedAssertion represents the SAML object of the same name.
See http://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf
type EncryptionMethod ¶
type EncryptionMethod struct {
Algorithm string `xml:"Algorithm,attr"`
}
EncryptionMethod represents the XMLSEC object of the same name
type Endpoint ¶
type Endpoint struct {
Binding string `xml:"Binding,attr"`
Location string `xml:"Location,attr"`
ResponseLocation string `xml:"ResponseLocation,attr,omitempty"`
}
Endpoint represents the SAML EndpointType object.
See http://docs.oasis-open.org/security/saml/v2.0/saml-metadata-2.0-os.pdf section 2.2.2
type EntitiesDescriptor ¶
type EntitiesDescriptor struct {
XMLName xml.Name `xml:"urn:oasis:names:tc:SAML:2.0:metadata EntitiesDescriptor"`
EntityDescriptor []*Metadata `xml:"urn:oasis:names:tc:SAML:2.0:metadata EntityDescriptor"`
}
EntitiesDescriptor represents the SAML object of the same name.
See http://docs.oasis-open.org/security/saml/v2.0/saml-metadata-2.0-os.pdf section 2.3.1
type IDPSSODescriptor ¶
type IDPSSODescriptor struct {
XMLName xml.Name `xml:"urn:oasis:names:tc:SAML:2.0:metadata IDPSSODescriptor"`
ProtocolSupportEnumeration string `xml:"protocolSupportEnumeration,attr"`
KeyDescriptor []KeyDescriptor `xml:"KeyDescriptor"`
NameIDFormat []string `xml:"NameIDFormat"`
SingleSignOnService []Endpoint `xml:"SingleSignOnService"`
}
IDPSSODescriptor represents the SAML IDPSSODescriptorType object.
See http://docs.oasis-open.org/security/saml/v2.0/saml-metadata-2.0-os.pdf section 2.4.3
type IdentityProvider ¶
type IdentityProvider struct {
// Identifier of the IdP entity (must be a URI)
EntityID string
MetadataURL string
SSOURL string
SecurityOpts
// File system location of the private key file
KeyFile string
// File system location of the cert file
CertFile string
// Private key can also be provided as a param
// For now we need to write to a temp file since xmlsec requires a physical file to validate the document signature
PrivkeyPEM string
// Cert can also be provided as a param
// For now we need to write to a temp file since xmlsec requires a physical file to validate the document signature
PubkeyPEM string
// Service provide settings
SPMetadataURL string
SPMetadata *Metadata
SPAcsURL string
// contains filtered or unexported fields
}
IdentityProvider represents an identity provider.
func (*IdentityProvider) Cert ¶
func (idp *IdentityProvider) Cert() (*pem.Block, error)
Cert returns a *pem.Block value that corresponds to the IdP's certificate.
func (*IdentityProvider) GenerateResponse ¶ added in v0.12.0
func (*IdentityProvider) GetSPCertFile ¶
func (idp *IdentityProvider) GetSPCertFile() (string, error)
GetSPCertFile returns a physical path where the SP's certificate can be accessed.
func (*IdentityProvider) GetSPMetadata ¶
func (idp *IdentityProvider) GetSPMetadata() (*Metadata, error)
GetSPMetadata returns a the SP's metadata value
func (*IdentityProvider) Metadata ¶
func (idp *IdentityProvider) Metadata() (*Metadata, error)
Metadata returns a metadata value based on the IdP's data.
func (*IdentityProvider) MetadataHandler ¶ added in v0.9.8
func (idp *IdentityProvider) MetadataHandler(w http.ResponseWriter, r *http.Request)
MetadataHandler generates and serves the IdP's metadata.xml file.
func (*IdentityProvider) NewLoginRequest ¶ added in v0.9.8
func (idp *IdentityProvider) NewLoginRequest(spMetadataURL string, authFn Authenticator) (*LoginRequest, error)
NewLoginRequest creates a login request against an SP.
func (*IdentityProvider) PrivkeyFile ¶
func (idp *IdentityProvider) PrivkeyFile() (string, error)
PrivkeyFile returns a physical path where the IdP's key can be accessed.
func (*IdentityProvider) PubkeyFile ¶
func (idp *IdentityProvider) PubkeyFile() (string, error)
PubkeyFile returns a physical path where the IdP's public key can be accessed.
type IdpAuthnRequest ¶
type IdpAuthnRequest struct {
IDP *IdentityProvider
// Address set in the SubjectConfirmation element of the Assertion
Address string
RelayState string
RequestBuffer []byte
Request AuthnRequest
ServiceProviderMetadata *Metadata
ACSEndpoint *IndexedEndpoint
Assertion *Assertion
AssertionBuffer []byte
Response *Response
}
IdpAuthnRequest is used by IdentityProvider to handle a single authentication request.
func (*IdpAuthnRequest) MakeAssertion ¶
func (req *IdpAuthnRequest) MakeAssertion(session *Session) error
MakeAssertion produces a SAML assertion for the given request and assigns it to req.Assertion.
func (*IdpAuthnRequest) MakeResponse ¶
func (req *IdpAuthnRequest) MakeResponse() error
MakeResponse computes the Response field of the IdpAuthnRequest
func (*IdpAuthnRequest) MarshalAssertion ¶
func (req *IdpAuthnRequest) MarshalAssertion() error
MarshalAssertion produces a valid and signed XML assertion.
type IndexedEndpoint ¶
type IndexedEndpoint struct {
Binding string `xml:"Binding,attr"`
Location string `xml:"Location,attr"`
Index int `xml:"index,attr"`
}
IndexedEndpoint represents the SAML IndexedEndpointType object.
See http://docs.oasis-open.org/security/saml/v2.0/saml-metadata-2.0-os.pdf section 2.2.3
type Issuer ¶
type Issuer struct {
XMLName xml.Name `xml:"urn:oasis:names:tc:SAML:2.0:assertion Issuer"`
Format string `xml:",attr"`
Value string `xml:",chardata"`
}
Issuer represents the SAML object of the same name.
See http://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf
type KeyDescriptor ¶
type KeyDescriptor struct {
Use string `xml:"use,attr"`
KeyInfo KeyInfo `xml:"http://www.w3.org/2000/09/xmldsig# KeyInfo"`
EncryptionMethods []EncryptionMethod `xml:"EncryptionMethod"`
}
KeyDescriptor represents the XMLSEC object of the same name
type KeyInfo ¶
type KeyInfo struct {
XMLName xml.Name `xml:"http://www.w3.org/2000/09/xmldsig# KeyInfo"`
Certificate string `xml:"X509Data>X509Certificate"`
}
KeyInfo represents the XMLSEC object of the same name
type LoginRequest ¶ added in v0.9.8
type LoginRequest struct {
// contains filtered or unexported fields
}
LoginRequest represents a login request that the IdP creates in order to try autenticating against a SP.
func (*LoginRequest) PostForm ¶ added in v0.9.8
func (lr *LoginRequest) PostForm(w http.ResponseWriter, r *http.Request)
PostForm creates and serves a form that is used to authenticate to the SP.
type Metadata ¶
type Metadata struct {
XMLName xml.Name `xml:"urn:oasis:names:tc:SAML:2.0:metadata EntityDescriptor"`
ValidUntil time.Time `xml:"validUntil,attr"`
CacheDuration *CacheDuration `xml:"cacheDuration,attr,omitempty"`
EntityID string `xml:"entityID,attr"`
SPSSODescriptor *SPSSODescriptor `xml:"SPSSODescriptor"`
IDPSSODescriptor *IDPSSODescriptor `xml:"IDPSSODescriptor"`
}
Metadata represents the SAML EntityDescriptor object.
See http://docs.oasis-open.org/security/saml/v2.0/saml-metadata-2.0-os.pdf section 2.3.2
func GetMetadata ¶
GetMetadata takes the URL of a metadata.xml file, downloads and parses it. Returns a *Metadata value.
func (*Metadata) SSOService ¶ added in v0.12.0
type NameID ¶
type NameID struct {
Format string `xml:",attr"`
NameQualifier string `xml:",attr"`
SPNameQualifier string `xml:",attr"`
Value string `xml:",chardata"`
}
NameID represents the SAML object of the same name.
See http://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf
type NameIDPolicy ¶
type NameIDPolicy struct {
XMLName xml.Name `xml:"urn:oasis:names:tc:SAML:2.0:protocol NameIDPolicy"`
AllowCreate bool `xml:",attr"`
Format string `xml:",chardata"`
}
NameIDPolicy represents the SAML object of the same name.
See http://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf
type Response ¶
type Response struct {
XMLName xml.Name `xml:"urn:oasis:names:tc:SAML:2.0:protocol Response"`
Destination string `xml:",attr"`
Signature *xmlsec.Signature
ID string `xml:",attr"`
InResponseTo string `xml:",attr"`
IssueInstant time.Time `xml:",attr"`
Version string `xml:",attr"`
Issuer *Issuer `xml:"urn:oasis:names:tc:SAML:2.0:assertion Issuer"`
Status *Status `xml:"urn:oasis:names:tc:SAML:2.0:protocol Status"`
EncryptedAssertion *EncryptedAssertion
Assertion *Assertion `xml:"urn:oasis:names:tc:SAML:2.0:assertion Assertion"`
XMLText []byte `xml:"-"`
}
Response represents the SAML object of the same name.
See http://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf section 3.3.3
type SPSSODescriptor ¶
type SPSSODescriptor struct {
XMLName xml.Name `xml:"urn:oasis:names:tc:SAML:2.0:metadata SPSSODescriptor"`
AuthnRequestsSigned bool `xml:",attr"`
WantAssertionsSigned bool `xml:",attr"`
ProtocolSupportEnumeration string `xml:"protocolSupportEnumeration,attr"`
KeyDescriptor []KeyDescriptor `xml:"KeyDescriptor"`
ArtifactResolutionService []IndexedEndpoint `xml:"ArtifactResolutionService"`
SingleLogoutService []Endpoint `xml:"SingleLogoutService"`
ManageNameIDService []Endpoint
NameIDFormat []string `xml:"NameIDFormat"`
AssertionConsumerService []IndexedEndpoint `xml:"AssertionConsumerService"`
AttributeConsumingService []interface{}
}
SPSSODescriptor represents the SAML SPSSODescriptorType object.
See http://docs.oasis-open.org/security/saml/v2.0/saml-metadata-2.0-os.pdf section 2.4.2
type SecurityOpts ¶
SecurityOpts allows to bypass some security checks.
type ServiceProvider ¶
type ServiceProvider struct {
MetadataURL string
// Identifier of the SP entity (must be a URI)
EntityID string
// Assertion Consumer Service URL
// Specifies where the <AuthnResponse> message MUST be returned to
ACSURL string
// SAML protocol binding to be used when returning the <Response> message.
// Supports only HTTP-POST binding
ACSBinding string
AllowIdpInitiated bool
SecurityOpts
// File system location of the private key file
KeyFile string
// File system location of the cert file
CertFile string
// Private key can also be provided as a param
// For now we need to write to a temp file since xmlsec requires a physical file to validate the document signature
PrivkeyPEM string
// Cert can also be provided as a param
// For now we need to write to a temp file since xmlsec requires a physical file to validate the document signature
PubkeyPEM string
DTDFile string
// Identity Provider settings the Service Provider instance should use
IdPMetadataURL string
IdPMetadataXML []byte
IdPMetadata *Metadata
// Identifier of the SP entity (must be a URI)
IdPEntityID string
// File system location of the cert file
IdPCertFile string
// Cert can also be provided as a param
// For now we need to write to a temp file since xmlsec requires a physical file to validate the document signature
IdPPubkeyPEM string
// SAML protocol binding to be used when sending the <AuthnRequest> message
IdPSSOServiceBinding string
// URL Target of the IdP where the SP will send the AuthnRequest message
IdPSSOServiceURL string
// contains filtered or unexported fields
}
ServiceProvider represents a service provider.
func (*ServiceProvider) AssertResponse ¶ added in v0.11.0
func (sp *ServiceProvider) AssertResponse(base64Res string) (*Assertion, error)
AssertResponse parses and validates a SAML response and its assertion
func (*ServiceProvider) AuthnRequestURL ¶ added in v0.11.0
func (sp *ServiceProvider) AuthnRequestURL(relayState string) (string, error)
AuthnRequestURL creates SAML 2.0 AuthnRequest redirect URL, aka SP-initiated login (SP->IdP). The data is passed in the ?SAMLRequest query parameter and the value is base64 encoded and deflate-compressed <AuthnRequest> XML element. The final redirect destination that will be invoked on successful login is passed using ?RelayState query parameter.
func (*ServiceProvider) Cert ¶
func (sp *ServiceProvider) Cert() (*pem.Block, error)
Cert returns a *pem.Block value that corresponds to the SP's certificate.
func (*ServiceProvider) GetIdPCertFile ¶
func (sp *ServiceProvider) GetIdPCertFile() (string, error)
GetIdPCertFile returns a physical path where the IdP certificate can be accessed.
func (*ServiceProvider) Metadata ¶
func (sp *ServiceProvider) Metadata() (*Metadata, error)
Metadata returns a metadata value based on the SP's data.
func (*ServiceProvider) MetadataXML ¶ added in v0.11.0
func (sp *ServiceProvider) MetadataXML() ([]byte, error)
MetadataXML returns SAML 2.0 Service Provider metadata XML.
func (*ServiceProvider) NewAuthnRequest ¶ added in v0.11.0
func (sp *ServiceProvider) NewAuthnRequest() (*AuthnRequest, error)
NewAuthnRequest creates a new AuthnRequest object for the given IdP URL.
func (*ServiceProvider) NewPostSAMLRequest ¶ added in v0.12.0
func (sp *ServiceProvider) NewPostSAMLRequest() (string, error)
NewSAMLRequest creates SAML 2.0 AuthnRequest The <AuthnRequest> XML element is base64 encoded
func (*ServiceProvider) NewRedirectSAMLRequest ¶ added in v0.12.0
func (sp *ServiceProvider) NewRedirectSAMLRequest() (string, error)
NewSAMLRequest creates SAML 2.0 AuthnRequest The <AuthnRequest> XML element is deflate-compressed, base64 and URL encoded
func (*ServiceProvider) ParseIdPMetadata ¶ added in v0.12.0
func (sp *ServiceProvider) ParseIdPMetadata() (*Metadata, error)
func (*ServiceProvider) PrivkeyFile ¶
func (sp *ServiceProvider) PrivkeyFile() (string, error)
PrivkeyFile returns a physical path where the SP's key can be accessed.
func (*ServiceProvider) PubkeyFile ¶
func (sp *ServiceProvider) PubkeyFile() (string, error)
PubkeyFile returns a physical path where the SP's public certificate can be accessed.
type Session ¶
type Session struct {
ID string
CreateTime time.Time
ExpireTime time.Time
Index string
NameID string
Groups []string
UserID string
UserFullname string
UserName string
UserEmail string
UserCommonName string
UserSurname string
UserGivenName string
}
Session represents a user session. It is returned by the SessionProvider implementation's GetSession method. Fields here are used to set fields in the SAML assertion.
type Status ¶
type Status struct {
XMLName xml.Name `xml:"urn:oasis:names:tc:SAML:2.0:protocol Status"`
StatusCode StatusCode
}
Status represents the SAML object of the same name.
See http://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf
type StatusCode ¶
type StatusCode struct {
XMLName xml.Name `xml:"urn:oasis:names:tc:SAML:2.0:protocol StatusCode"`
Value string `xml:",attr"`
}
StatusCode represents the SAML object of the same name.
See http://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf
type Subject ¶
type Subject struct {
XMLName xml.Name `xml:"urn:oasis:names:tc:SAML:2.0:assertion Subject"`
NameID *NameID
SubjectConfirmation *SubjectConfirmation
}
Subject represents the SAML object of the same name.
See http://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf
type SubjectConfirmation ¶
type SubjectConfirmation struct {
Method string `xml:",attr"`
SubjectConfirmationData SubjectConfirmationData
}
SubjectConfirmation represents the SAML object of the same name.
See http://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf
type SubjectConfirmationData ¶
type SubjectConfirmationData struct {
Address string `xml:",attr"`
InResponseTo string `xml:",attr"`
NotOnOrAfter time.Time `xml:",attr"`
Recipient string `xml:",attr"`
}
SubjectConfirmationData represents the SAML object of the same name.
See http://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf
type SubjectLocality ¶
type SubjectLocality struct {
Address string `xml:",attr"`
}
SubjectLocality represents the SAML object of the same name.
See http://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
_example
|
|
|
servers/idp-server
command
|
|
|
servers/sp-server
command
|
|
|
Package xmlsec is a wrapper around the xmlsec1 command https://www.aleksey.com/xmlsec/index.html
|
Package xmlsec is a wrapper around the xmlsec1 command https://www.aleksey.com/xmlsec/index.html |
