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

Complex keys in the "keys_to_sign" property #852

Open
ridgarou opened this issue Mar 4, 2024 · 3 comments
Open

Complex keys in the "keys_to_sign" property #852

ridgarou opened this issue Mar 4, 2024 · 3 comments

Comments

@ridgarou
Copy link

ridgarou commented Mar 4, 2024

Version of KrakenD you are using
v2.5.0

Description
I have a backend service that, upon login, returns the access_token in a nested object and I would like to sign it with the JWT signing functionality.

{
  "user": {
    "access_token": {
                "aud": [ "xxxxxxxxxxxxxxxxxxxxxx" ],
                "exp": 1709545713,
                "iat": 1709542113,
                "jti": "e1436772-d038-4488-8870-127d35833c1c",
                "nbf": 1709542113,
                "scope": "xxxxxxxxxxxxxxxxxxxxxx-yyyyyyyy",
                "sub": "6a792e214a3ca1e4b1d90d6b301c8babc89415cc",
            },
            "expires_at": 1709545713655
  }
}

Problem
The JWT signing functionality only allows you to specify properties to sign in keys_to_sign that are at the root of the main object. In this case, the access_token property is nested within the user object.

Is there a way to sign the user.access_token property with the JWT signing functionality?

@alombarte
Copy link
Member

Hello @ridgarou , this functionality is not currently supported

@ridgarou
Copy link
Author

ridgarou commented Mar 5, 2024

Thanks for the response. I understand that this functionality is not currently available. I would like to know if it would be possible to implement it in the future.

I think this would be very useful for users who need to sign tokens with more complex object structures.

@alombarte
Copy link
Member

I will leave this issue open for a while so people can upvote the functionality with a 👍 . It is the first time I've seen this requirement in six years, so I don't think it is very common among KrakenD users, but let's see what the community says

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

No branches or pull requests

2 participants