Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Handling case when Jwk doesn't have 'use' parameter #116

Merged
merged 6 commits into from
Jan 16, 2020

Conversation

manpreet-compro
Copy link
Contributor

#113

Description

Updated the code to handle the case when 'use' parameter in jwk key is not present on is not having any value. As per spec, https://tools.ietf.org/html/rfc7517#section-4.2

Use of the "use" member is OPTIONAL, unless the application requires its presence.

Added a check to check for presence first, if key is present and having non blank value then compare if value is 'sig' as per spec.

References

This PR is submitted in response to Open issue #24

Testing

Updated test cases to include 2 test cases

  • value of 'use' is blank (Should pass)
  • value of 'use' is 'enc' (Should fail)

Command npm run test can be used to test the implementation

Checklist

  • I have added documentation for new/changed functionality in this PR or in auth0.com/docs
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not master

@manpreet-compro manpreet-compro requested a review from a team January 9, 2020 07:41
@manpreet-compro manpreet-compro changed the title Jwk without use param Get Signing Key when Jwk key doesn't have 'use' parameter Jan 9, 2020
@manpreet-compro manpreet-compro changed the title Get Signing Key when Jwk key doesn't have 'use' parameter Handling case when Jwk doesn't have 'use' parameter Jan 9, 2020
tests/jwksClient.tests.js Outdated Show resolved Hide resolved
tests/jwksClient.tests.js Outdated Show resolved Hide resolved
src/JwksClient.js Outdated Show resolved Hide resolved
@lbalmaceda lbalmaceda added this to the v1-Next milestone Jan 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants