Skip to content

Commit

Permalink
fix(protocol): user entity id not encoded correctly (#98)
Browse files Browse the repository at this point in the history
This fixes an issue where the protocol.UserEntity field ID was encoded with Base64 URL Encoding with padding instead of without padding.

Fixes #97
  • Loading branch information
james-d-elliott authored Jan 28, 2023
1 parent 66fafd6 commit 3d8dfc7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions protocol/attestation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ var testAttestationOptions = []string{
"user": {
"name": "self",
"displayName": "self",
"id": "2iEAAAAAAAAAAA=="
"id": "2iEAAAAAAAAAAA"
},
"pubKeyCredParams": [
{
Expand All @@ -116,7 +116,7 @@ var testAttestationOptions = []string{
"user": {
"name": "flort",
"displayName": "flort",
"id": "1DMAAAAAAAAAAA=="
"id": "1DMAAAAAAAAAAA"
},
"pubKeyCredParams": [
{
Expand All @@ -142,7 +142,7 @@ var testAttestationOptions = []string{
"user": {
"name": "testuser1",
"displayName": "testuser1",
"id": "1zMAAAAAAAAAAA=="
"id": "1zMAAAAAAAAAAA"
},
"pubKeyCredParams": [
{
Expand Down
2 changes: 1 addition & 1 deletion protocol/entities.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ type UserEntity struct {
// authentication and authorization decisions MUST be made on the basis of this id
// member, not the displayName nor name members. See Section 6.1 of
// [RFC8266](https://www.w3.org/TR/webauthn/#biblio-rfc8266).
ID []byte `json:"id"`
ID URLEncodedBase64 `json:"id"`
}

0 comments on commit 3d8dfc7

Please sign in to comment.