Skip to content

Commit

Permalink
update file
Browse files Browse the repository at this point in the history
  • Loading branch information
sbishel committed Aug 25, 2020
1 parent 564550c commit bfc9414
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions build_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ func (sp *SAMLServiceProvider) buildAuthnRequest(includeSig bool) (*etree.Docume
authnRequest.CreateElement("saml:Issuer").SetText(sp.IdentityProviderIssuer)
}

nameIdPolicy := authnRequest.CreateElement("samlp:NameIDPolicy")
nameIdPolicy.CreateAttr("AllowCreate", "true")
nameIdPolicy.CreateAttr("Format", sp.NameIdFormat)
if sp.NameIdFormat != "" {
nameIdPolicy := authnRequest.CreateElement("samlp:NameIDPolicy")
nameIdPolicy.CreateAttr("AllowCreate", "true")
nameIdPolicy.CreateAttr("Format", sp.NameIdFormat)
}

if sp.RequestedAuthnContext != nil {
requestedAuthnContext := authnRequest.CreateElement("samlp:RequestedAuthnContext")
Expand Down

0 comments on commit bfc9414

Please sign in to comment.