Problem/Motivation

When encoding the JWT, custom JWT headers (like crit) could be set. However the \Drupal\jwt\JsonWebToken\JsonWebTokenInterface does not have a way to set any additional headers.

Proposed resolution

Add option to provide headers and key ID as accepted by Firebase\JWT\JWT::encode

Comments

vijaycs85 created an issue. See original summary.

pwolanin’s picture

Version: 8.x-1.x-dev » 2.x-dev
pwolanin’s picture

Category: Task » Feature request
Issue summary: View changes
pwolanin’s picture

Title: Allow to send custom JWT headers » Support adding custom JWT headers
pwolanin’s picture

Status: Active » Needs review
StatusFileSize
new3.57 KB

Need to add tests

pwolanin’s picture

StatusFileSize
new6.47 KB
pwolanin’s picture

StatusFileSize
new8.73 KB

some more fixes

pwolanin’s picture

StatusFileSize
new8.97 KB

a couple more test asserts regarding special headers alg and typ

pwolanin’s picture

Title: Support adding custom JWT headers » Support adding custom JWT headers and also make the headers available after decoding
Status: Needs review » Fixed

  • pwolanin committed 68218b19 on 2.x
    Issue #3256486 by pwolanin: Support adding custom JWT headers and also...
vijaycs85’s picture

Thanks @pwolanin. tested and confirmed it is working with custom headers.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.