-
Notifications
You must be signed in to change notification settings - Fork 353
Added algorithm option to jwt policy #999
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
Added algorithm option to jwt policy #999
Conversation
Codecov Report
|
The tests failing in these pipelines, failed once(with the same timeout error) locally for me, but have since passed. Is there a way to re-try these pipelines? |
I can take care of this and make sure all tests pass. Can you rebase with latest master? |
faf9712
to
bccffbf
Compare
Awesome, thank you. I just pushed up that rebase, let me know if there is anything else I can do. |
@@ -38,6 +38,10 @@ module.exports = { | |||
type: 'boolean', | |||
default: true, | |||
description: 'Value istructing the gateway whether verify the sub against the internal SOC' | |||
}, | |||
algorithms: { | |||
type: 'array', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should probably specify the items
to be a string and then enum the possible choice. JWT has a fixed set of algorithms
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense, I just pushed up a change to reflect that. I wasn't 100% sure about the syntax so let me know if I need to modify it at all.
8a957db
to
954df8f
Compare
954df8f
to
7ae36e8
Compare
…ptions Added algorithm option to jwt policy
Hello,
Express-gateway is fantastic — it has become the backbone of our team’s api architecture. That being said, we have run into one small issue.
Problem: The JWT policy does not currently accept algorithms as an option to specify which algorithms can be used to verify tokens. Under the hood I noticed express-gateway uses
passport-jwt
, which usesjsonwebtoken
. This is the same package we use. Bothpassport-jwt
andjsonwebtoken
support specifying algorithms. This is a good feature because otherwise jsonwebtoken will allow any algorithm to be used depending on what is decoded via the JWT header. Specifying algorithms allows enforcing of standards across our apis.Solution: Expose the algorithms option in the JWT policy.
Here is the pr for the docs update: ExpressGateway/express-gateway.io#336