web-token / jwt-doc

Documentation for the JWT Framework
MIT License
12 stars 19 forks source link

JWS "After" now includes several deprecated classes #12

Closed moderndeveloperllc closed 5 years ago

moderndeveloperllc commented 5 years ago

Migrating from JOSE, the JWS loading "After" now includes deprecated classes that I can find no alternative for. CompactSerializer is deprecated, but there is no guidance on what replacement to use. I think JSONFlattenedSerializer as I'm using that to create(?) my JWS, but that expects a Jose\Component\Core\Converter\JsonConverter (deprecated), not a Jose\Component\Core\Util\JsonConverter.

Should I actually be trying to use 2.0 instead?

Spomky commented 5 years ago

Hi @moderndeveloperllc,

CompactSerializer is not deprecated (and there no reason to deprecate it). I am working on a PR to prepare the removal of Jose\Component\Core\Converter\JsonConverter. All objects that use it will be modify to accept a null value indicating the new internal Jose\Component\Core\Util\JsonConverter has to be used. As an example, youcan see the new __constructor method for the JWSBuilder class. The 2.0 branch is not yet ready to by used, but you can try to play with it.

I will update the doc when this PR is ready to be merged

moderndeveloperllc commented 5 years ago

Sorry, I think I meant StandardConverter. I see that you are changing the signature to not require that specific JSON class. I'll close.

fidding commented 4 years ago

just like this

    // v1.3
    $jsonConverter = new \Jose\Component\Core\Util\JsonConverter();

    $jwsBuilder = new Jose\Component\Signature\JWSBuilder(
        null,
        $algorithmManager
    );