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

Add "typ" attribute in JWT header when signing tokens #711

Closed
MinKyawNyunt opened this issue Apr 18, 2023 · 11 comments
Closed

Add "typ" attribute in JWT header when signing tokens #711

MinKyawNyunt opened this issue Apr 18, 2023 · 11 comments

Comments

@MinKyawNyunt
Copy link

Environment info:

  • KrakenD version: 2.2.1
  • System info: docker

Describe what are you trying to do:
Adding additional in Header

configuration:

{
      "endpoint": "/auth/login",
      "method": "POST",
      "backend": [
        {
          "host": [
            "http://nginx:81"
          ],
          "url_pattern": "/api/login",
          "sd": "static",
          "method": "POST",
          "extra_config": {
            "backend/http": {
              "return_error_details": "auth"
            }
          }
        }
      ],
      "extra_config": {
        "auth/signer": {
          "alg": "HS256",
          "kid": "user",
          "keys_to_sign": [
            "access_token",
            "refresh_token"
          ],
          "jwk_url": "http://nginx:81/api/jwk",
          "disable_jwk_security": true
        }
      },
      "input_headers": [
        "Accept",
        "Content-Type"
      ]
    },

jwt decode header output

{
  "alg": "HS256",
  "kid": "user"
}

expected decode header result

{
  "alg": "HS256",
  "kid": "user"
  "typ": "JWT"
}
@alombarte alombarte changed the title How To Add additional Header in JWT? Add "typ" attribute in JWT header when signing tokens Jun 21, 2023
@alombarte
Copy link
Member

Hi @MinKyawNyunt , this feature is not currently supported, but we can add it in future releases

@kpacha
Copy link
Member

kpacha commented Jun 21, 2023

for future references, the change should go here: https://github.com/krakendio/krakend-jose/blob/master/jws.go#L141

@github-actions
Copy link

This issue is easy for contributing. Everyone can work on this.


This is an automated comment. Responding to the bot or mentioning it won't have any effect

@AlyHKafoury
Copy link

Hello @kpacha @alombarte Can I work on this ?

@kpacha
Copy link
Member

kpacha commented Jul 18, 2023

@AlyHKafoury sure! contributions are always welcome!!!

@AlyHKafoury
Copy link

AlyHKafoury commented Jul 19, 2023

would this be enough ? krakend/krakend-jose#119 , or there is other places where the header will need to be modified.

@alombarte
Copy link
Member

Thank you very much @AlyHKafoury for your contribution! I see there are minor changes requested in the PR, if you add them we will release this in KrakenD 2.5 which is round the corner

@AlyHKafoury
Copy link

I will work on it now and see if I can get a clear

@kpacha
Copy link
Member

kpacha commented Jan 16, 2024

This will be released with v2.6, planned on mid Feb 2024

@AlyHKafoury
Copy link

AlyHKafoury commented Jan 16, 2024 via email

@alombarte
Copy link
Member

Hi @AlyHKafoury , thank you for your support! There are no urgent issues, but feel free to navigate through the almost 1000 questions and requests we opened have: https://github.com/search?l=&o=asc&q=user%3Akrakend&state=open&type=Issues
I am closing this issue, as this is already integrated on the master branch.

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

No branches or pull requests

4 participants