diff --git a/protocol/entities.go b/protocol/entities.go index 814e608..1d2f6e8 100644 --- a/protocol/entities.go +++ b/protocol/entities.go @@ -45,7 +45,7 @@ type UserEntity struct { // A human-palatable name for the user account, intended only for display. // For example, "Alex P. Müller" or "田中 倫". The Relying Party SHOULD let // the user choose this, and SHOULD NOT restrict the choice more than necessary. - DisplayName string `json:"displayName,omitempty"` + DisplayName string `json:"displayName"` // ID is the user handle of the user account entity. To ensure secure operation, // authentication and authorization decisions MUST be made on the basis of this id diff --git a/webauthn/registration_test.go b/webauthn/registration_test.go index ed689ab..a2c597d 100644 --- a/webauthn/registration_test.go +++ b/webauthn/registration_test.go @@ -35,8 +35,8 @@ func TestEntityEncoding(t *testing.T) { b64 bool have, expected string }{ - {"ShouldEncodeBase64", true, "abc", "{\"name\":\"\",\"id\":\"YWJj\"}"}, - {"ShouldEncodeString", false, "abc", "{\"name\":\"\",\"id\":\"abc\"}"}, + {"ShouldEncodeBase64", true, "abc", `{"name":"","displayName":"","id":"YWJj"}`}, + {"ShouldEncodeString", false, "abc", `{"name":"","displayName":"","id":"abc"}`}, } for _, tc := range testCases {