You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to sign each JWT with a secret that is shared in all micros. I need this because I want other micros to be able to decode given JWT and extract payload data and work upon it (e.g. user_id field in the payload).
When I try to create a JWT for the first consumer, it works just fine. But when I try to create it for the second consumer I'm getting the following error:
{u'secret': u"already exists with value 'secret'}
I'm not exactly sure but I think KONG/JWT requires unique secret for each consumer to create a JWT. Is it possible to configure JWT plugin properly to be able to use shared secret to sign JWTs?
PS: I'm not entirely sure that using a shared secret is a good practice. If there is a better way to do this please let me know. Thanks!
Thanks for the report @onuryavuz. This is expected behavior, given the unique constraint on secret- the question is why. Oauth2 secrets had the same constraint (incorrectly) that was removed in #2447; at the time I believed JWT entries required a unique constraint, but I believe I was incorrect in that assessment. From what I can tell, this secret can be removed safely, though it needs some testing.
Since this was initially opened in #1512, closing this as a dup, but we thank you for the report!
Summary
I want to sign each JWT with a secret that is shared in all micros. I need this because I want other micros to be able to decode given JWT and extract payload data and work upon it (e.g. user_id field in the payload).
When I try to create a JWT for the first consumer, it works just fine. But when I try to create it for the second consumer I'm getting the following error:
{u'secret': u"already exists with value 'secret'}
I'm not exactly sure but I think KONG/JWT requires unique secret for each consumer to create a JWT. Is it possible to configure JWT plugin properly to be able to use shared secret to sign JWTs?
PS: I'm not entirely sure that using a shared secret is a good practice. If there is a better way to do this please let me know. Thanks!
Steps To Reproduce
{u'secret': u"already exists with value 'secret'}
Additional Details & Logs
$ kong version
)v0.10.2
The text was updated successfully, but these errors were encountered: