-
Notifications
You must be signed in to change notification settings - Fork 52
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
server.issuer.keys.add() issue #56
Comments
@erinwu Can you please provide us will a minimal but complete repro case? |
@nulltoken Below is my code. const newKey = await server.issuer.keys.add({ // add a RSA-OAEP-256 encrypted key the newKey value should be |
@erinwu Thanks a lot for your answer. Can you please also describe the impact on your own use case this 'sig' normalization causes? What does it prevent you to do? How does this block you in your test process? |
@nulltoken Currently, our project is using no valid key found in issuer's jwks_uri for key parameters {"alg":"RSA-OAEP-256","use":"enc"} |
@erinwu OK. I think I've spotted the issue. This happened during #48 - async add(jwk) {
- const jwkUse = { use: 'sig', ...jwk };
+ async add(jwk: JWK.Key): Promise<JWK.Key> {
+ const jwkUse: JWK.Key = { ...jwk, use: 'sig' }; I'm not sure how that happened. However, it looks like we didn't have any test to cover this use case. Thanks for the report! We'll shortly revert to the previous behavior, add some tests to cover this behavior and publish a patch version. |
@nulltoken Thank you a lot for the help. |
@erinwu Version 3.0.3 is live on npm. Please confirm that your issue has been fixed. Thanks! |
@poveden @nulltoken It works perfectly. Thank you. |
What
use: 'enc'
keyLine of Code
oauth2-mock-server/src/lib/jwk-store.ts
Line 64 in 801fd2e
Suggested Fix
const jwkUse: JWK.Key = { use: 'sig', ...jwk};
The text was updated successfully, but these errors were encountered: