Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix to encode/decode credential id as base64url #631

Merged
merged 2 commits into from
Jul 16, 2024

Conversation

abcang
Copy link
Contributor

@abcang abcang commented Jul 16, 2024

Target branch: 4.9.x
Resolves issue #

  • It is a Bug fix
  • It is a New feature
  • Breaks BC
  • Includes Deprecations

Previously, the id of the PublicKeyCredential obtained by the PublicKeyCredentialDenormalizer was a raw base64url encoded string sent by the browser. However, with change #589, it is now converted to a base64-encoded string. This pull request reverts this behavior back to the previous one.

Also, I think it is correct to decode if only $id is passed when creating an instance, so I fixed this as well.

abcang and others added 2 commits July 16, 2024 19:31
The decoding method in the Credential class was updated to use 'decodeNoPadding' from Base64UrlSafe. This change improves efficiency and matches the desired coding style.
@Spomky Spomky merged commit 47b20e6 into web-auth:4.9.x Jul 16, 2024
15 checks passed
@Spomky Spomky added this to the 4.9.1 milestone Jul 16, 2024
@Spomky Spomky self-assigned this Jul 16, 2024
@Spomky Spomky added the bug Something isn't working label Jul 16, 2024
@Spomky
Copy link
Contributor

Spomky commented Jul 16, 2024

Many thanks!

@abcang
Copy link
Contributor Author

abcang commented Jul 17, 2024

Thank you for fixing my mistake and merging my pull request!

@abcang abcang deleted the abcang/fix_base64_encode branch July 17, 2024 01:04
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants