question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

JWK generate does not recognize options object

See original GitHub issue

Describe the bug

when running

JWK.generateSync("RSA", 2048, {use: 'enc'})

it produces error

TypeError: parameters argument must be a plain object when provided
    at asKey (/home/runner/JOSE/node_modules/jose/lib/jwk/import.js:39:11)
    at Object.generateSync (/home/runner/JOSE/node_modules/jose/lib/jwk/generate.js:40:14)
    at /home/runner/JOSE/index.js:11:5
    at Script.runInContext (vm.js:131:20)
    at Object.<anonymous> (/run_dir/interp.js:156:20)
    at Module._compile (internal/modules/cjs/loader.js:1133:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
    at Module.load (internal/modules/cjs/loader.js:977:32)
    at Function.Module._load (internal/modules/cjs/loader.js:877:14)

To Reproduce

Steps to reproduce the behaviour:

  1. Use JWK.generate/generateSync with options

Expected behaviour A clear and concise description of what you expected to happen.

should not produce error

Environment:

  • jose version: [e.g. v1.0.0]

1.27.1

  • node version: [e.g. v12.0.0]

v12.16

Additional context Add any other context about the problem here.

  • the bug is happening on latest jose too.
  • i have searched the issues tracker on github for similar issues and couldn’t find anything related.

i do not seem to be getting this issue on v12.18.0

the code which produced the error was run on repl.it

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
masad-frostcommented, Sep 10, 2020

This was fixed a few weeks ago. Just thought I’d let you know

0reactions
qin-guancommented, Jun 24, 2020

hmm okay, i will ask around and see if anyone at repl.it is able to resolve this. thanks for the help!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to parse JWK in Java - jwt - Stack Overflow
When I try jwk.toString() , I do see the kty key in the main json body. Why doesn't serialization/deserialization of the native JWK...
Read more >
JSON Web Key (JWK) — JWCrypto 1.4.2 documentation
A JSON Web Key is represented by a JWK object, related utility classes and ... will be generated according to the defaults or...
Read more >
jwk - Go Packages
First and foremost, this is a "per-object" option. Meaning that given the same serialized format, it is possible to generate two objects whose ......
Read more >
JSON Web Key Sets - Auth0
The JSON Web Key Set (JWKS) is a set of keys containing the public keys used to verify any JSON Web Token (JWT)...
Read more >
Generate JWT - IBM
Property label Property name Required Data type Title title No string Description description No string JSON Web Token (JWT) jwt No string
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found