Skip to content

Commit e985226

Browse files
committed
ArtifactResolve: change order of elements to satisfy ADFS
fixes #535
1 parent 7c9cb20 commit e985226

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

schema.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,12 +353,15 @@ func (r *ArtifactResolve) Element() *etree.Element {
353353
if r.Issuer != nil {
354354
el.AddChild(r.Issuer.Element())
355355
}
356-
artifact := etree.NewElement("samlp:Artifact")
357-
artifact.SetText(r.Artifact)
358-
el.AddChild(artifact)
359356
if r.Signature != nil {
357+
// ADFS requires that <Signature> come before <Artifact>.
358+
// ref: https://github.com/crewjam/saml/issues/535
359+
// ref: https://www.wiktorzychla.com/2017/09/adfs-and-saml2-artifact-binding-woes.html
360360
el.AddChild(r.Signature)
361361
}
362+
artifact := etree.NewElement("samlp:Artifact")
363+
artifact.SetText(r.Artifact)
364+
el.AddChild(artifact)
362365
return el
363366
}
364367

0 commit comments

Comments
 (0)