-
Notifications
You must be signed in to change notification settings - Fork 126
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
Adding option to not validate jwt #130
Comments
@kdstew, is the auth header preserved? |
Yes the auth header is passed through the gateway. |
Is your gateway the only element that knows the JWT key/secret? |
Yes, that is the goal. |
@kdstew If that is your goal, without knowing the secret key jwt cannot decode the token and pass the payload back to you. Option to stop the validate is not the right way. If you can maintain the key/secret in the Hapi itself, then you can write your own validate function as @nelsonic told above. Another way would be, in the gateway(Layer7/CA/ApiGee)? you can send the decoded values in the Hope this helps. |
@bboysathish
What about the use of asymmetric cryptography while signing jwt ? |
@kdstew, promise I'm not ignoring your request, just considering its implications for how the module is currently written ... |
Maybe the solution lays in the use of RSA based encryption in this situation. |
@vdeturckheim yes, encryption could be a good solution here. |
@kdstew I have implemented a way to Lines 49 to 51 in d44bf4b
Please check it and confirm. However since there is overlap between this and #120 (custom verification) |
@nelsonic Thanks for working through this. The
|
Added the option to |
@kdstew the latest release var customVerifyFunc = function (decoded, request, callback) {
return callback(null, true, decoded);
}; Let us know if you need anything else. 👍 (Closing this issue as I think its resolved, but feel free to re-open if not...) |
The use case here is our hapi server is siting behind a gateway that is validating the jwt token as the requests come through. So by the time the request makes it to the hapi server we already know the token is valid. But we do want to access the jwt payload to use the information. Would you be open to the addition of this functionality? I'd be happy to work up a PR if you are.
The text was updated successfully, but these errors were encountered: