-
Notifications
You must be signed in to change notification settings - Fork 92
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
How would I implement multiple secrets on the server side? #40
Comments
@avpavp, I had a similar requirement that I was playing around with. Support for each caller to have its own shared secret. I've ended up with the following as the starting function for my middleware, replacing the original "jwtauth.Verifier" call:
This decodes the payload of the JWT and looks for a required entry "caller" - this value is then passed to a function which connects to how ever you are storing your secrets. I am yet to really test this, but some initial curl attempts with varying tokens look good. I am going to try and find a better way to decode the payload and you may also want to support the ALG type changing based on caller. Also determineCallerSecret() should return an err, not just an empty string - but this was quick first pass. EDIT: I'll also include what my testing router looks like (using gorilla/mux):
|
note, underlying lib in master has changed to https://github.com/lestrrat-go/jwx but jwtauth api is largely the same |
I'd like to have the possibility to have different clients use different secrets - how would I test against multiple secrets on the server side?
Thanks!
The text was updated successfully, but these errors were encountered: