jonasroussel / dart_jsonwebtoken

A dart implementation of the famous javascript library 'jsonwebtoken'
MIT License
87 stars 29 forks source link

Any option to change the headers in sign method ? #12

Closed hiroshihorie closed 3 years ago

hiroshihorie commented 3 years ago

It looks like it's hard-coded now, but it would be nice if I could provide this in parameters. For example, Sign in with Apple requires "kid" in the header.

For my own purpose, I will create a fork.

Thank you! Hiroshi

jonasroussel commented 3 years ago

Hello,

It's a good idea. I will add this option soon. probably something like this :

JWT(
  { 'foo': 'bar' },
  customHeaders: { 'kid': '...' }
);
jonasroussel commented 3 years ago

Added in v2.3.0 (https://pub.dev/packages/dart_jsonwebtoken/versions/2.3.0)