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

Support for a custom json encoder #119

Closed

Conversation

ahmadnazir
Copy link

@ahmadnazir ahmadnazir commented Sep 13, 2017

The current implementation relies on the native php functions for encoding/decoding json. The flags provided are JSON_UNESCAPED_SLASHES.

Depending on who creates the access token, the json encoding rules might be different. I have a case where I am getting an access token from Microsoft and the special characters are not encoded in json strings, and hence I have to use JSON_UNESCAPED_UNICODE as well.

This commit supports injecting a custom Json encoder.

Then main changes are:

  • All places that refer to encoder have been renamed to base64Encoder
  • Methods setEncoder are renamed to setBase64Encoder
  • namespace \Namshi\JOSE\Base64 is moved to \Namshi\JOSE\Encoder to support json encoders along with other encoders
  • The default JsonEncoder class is added

@odino
Copy link
Contributor

odino commented Sep 17, 2017

Hi @ahmadnazir,

I just added a deprecation notice to this repo: since we're not using it anymore, it's very hard for us to keep developing namshi/jose. Happy to give it out to other maintainers if anyone wants to give it a shot! :)

At the same time, I'd recommend migrating to firebase/php-jwt as it seems to be here to stay :)

@ahmadnazir ahmadnazir closed this Aug 16, 2022
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

Successfully merging this pull request may close these issues.

None yet

2 participants