From 9a7938219109b9d9c1b4301978c9d5657eb2422f Mon Sep 17 00:00:00 2001 From: Andriy Senyshyn Date: Thu, 8 Feb 2018 20:52:35 +0200 Subject: [PATCH] removed IDPSSODescriptor from SP metadata --- saml.go | 2 +- types/metadata.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/saml.go b/saml.go index 8ad7cdd..410b404 100644 --- a/saml.go +++ b/saml.go @@ -79,7 +79,7 @@ func (sp *SAMLServiceProvider) Metadata() (*types.EntityDescriptor, error) { return &types.EntityDescriptor{ ValidUntil: time.Now().UTC().Add(time.Hour * 24 * 7), // 7 days EntityID: sp.ServiceProviderIssuer, - SPSSODescriptor: types.SPSSODescriptor{ + SPSSODescriptor: &types.SPSSODescriptor{ AuthnRequestsSigned: sp.SignAuthnRequests, WantAssertionsSigned: !sp.SkipSignatureValidation, ProtocolSupportEnumeration: SAMLProtocolNamespace, diff --git a/types/metadata.go b/types/metadata.go index d13a742..a709918 100644 --- a/types/metadata.go +++ b/types/metadata.go @@ -11,9 +11,9 @@ type EntityDescriptor struct { XMLName xml.Name `xml:"urn:oasis:names:tc:SAML:2.0:metadata EntityDescriptor"` ValidUntil time.Time `xml:"validUntil,attr"` // SAML 2.0 8.3.6 Entity Identifier could be used to represent issuer - EntityID string `xml:"entityID,attr"` - SPSSODescriptor SPSSODescriptor `xml:"SPSSODescriptor"` - IDPSSODescriptor IDPSSODescriptor `xml:"IDPSSODescriptor"` + EntityID string `xml:"entityID,attr"` + SPSSODescriptor *SPSSODescriptor `xml:"SPSSODescriptor,omitempty"` + IDPSSODescriptor *IDPSSODescriptor `xml:"IDPSSODescriptor,omitempty"` } type Endpoint struct {