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

Can't encode token with .pem secret on Windows #150

Open
alexcampbell86 opened this issue Nov 1, 2021 · 3 comments
Open

Can't encode token with .pem secret on Windows #150

alexcampbell86 opened this issue Nov 1, 2021 · 3 comments

Comments

@alexcampbell86
Copy link

Summary

I am trying to encode a token on Windows using the following command:

jwt encode --alg RS256 --exp "+60 sec" --iss <issuer> --secret=@<key_name>.pem

I am getting the errors:

Something went awry creating the jwt

InvalidKeyFormat

The same key in .pem format works with the same command when I run it on Mac. Any ideas why there is an issue on Windows?

Steps to reproduce

Expected behavior

Equivalent .pem secret works the same on Windows as it does on Mac.

@mike-engel
Copy link
Owner

Hey @alexcampbell86, thanks for your patience on this! Do you have a .pem file you could share? I just changed the test suite to run on windows as well (not sure why it didn't before) and everything passes. Could you also try it again with the latest version (5.0.0)?

@marcb
Copy link

marcb commented Jan 13, 2023

@mike-engel I was impacted by this issue today. What would you need to triage?

@mike-engel
Copy link
Owner

@marcb a .pem file that's valid, and ideally works on macos but fails on windows would be good. Once I have that, I can add it to the test suite and it should start failing on the windows test suite and I can hopefully fix the bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants