Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions service_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -1614,8 +1614,6 @@ func (sp *ServiceProvider) nameIDFormat() string {
case "":
// To maintain library back-compat, use "transient" if unset.
nameIDFormat = string(TransientNameIDFormat)
case UnspecifiedNameIDFormat:
// Spec defines an empty value as "unspecified" so don't set one.
default:
nameIDFormat = string(sp.AuthnNameIDFormat)
}
Expand Down
2 changes: 1 addition & 1 deletion service_provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func TestSPCanSetAuthenticationNameIDFormat(t *testing.T) {
s.AuthnNameIDFormat = UnspecifiedNameIDFormat
req, err = s.MakeAuthenticationRequest("", HTTPRedirectBinding, HTTPPostBinding)
assert.Check(t, err)
assert.Check(t, is.Equal("", *req.NameIDPolicy.Format))
assert.Check(t, is.Equal(string(UnspecifiedNameIDFormat), *req.NameIDPolicy.Format))

// explicitly set to "emailAddress"
s.AuthnNameIDFormat = EmailAddressNameIDFormat
Expand Down