jwt-framework
jwt-framework copied to clipboard
Updating from the deprecated Jose\Easy\*
Would you kindly provide some documentation on how to upgrade from Jose\Easy? There are so many classes and methods within the framework that I get lost on how to reimplement even the simplest things, such as
$jwt = Load::jws($accessToken)
->algs(['RS256', 'RS512'])
->exp()
->iat(1000)
->nbf(1000)
->iss($relmUri)
->keyset(new JWKSet($certs))
->run();
$claims = $jwt->claims->all() ?? [];
$header = $jwt->header->all() ?? [];
Thanks lots in advance
Hi,
The Easy
component was removed in v3.0
See https://web-token.spomky-labs.com/migration-1/from-v1.x-to-v2.0-1#list-of-deprecations
There is no replacement for the moment.
Oh, sorry for not typing things out better. I'm aware that Easy
was dropped. My question aimed at how one would rewrite the 2.2
Easy
code to use 3.0
classes.
Actually, the v3.0 is quite boring: it is just the v2.x minus deprecated features plus dependency updates. It should be possible to use the same classes with a limited number of changes
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@Spomky So what you're saying is that one should use the Easy
classes still although it's being abandoned? I think the question of @killua-eu was more targeted to how a migration path could look from using Easy
to whatever is suitable now. I have the feeling this wasn't really answered, but I might have missed something.
yup, I'm still stuck on version 2 because I couldn't see an easy migration path. The question was just how to rewrite
$jwt = Load::jws($accessToken)
->algs(['RS256', 'RS512'])
->exp()
->iat(1000)
->nbf(1000)
->iss($relmUri)
->keyset(new JWKSet($certs))
->run();
in a way that Easy isn't used.
Hi @killua-eu,
Excuse me, I completely missed answering your request. Please follw the link to see a working example where a token is loaded with the exact same verifications: https://phpsandbox.io/n/green-ben-quadinaros-gbahy I hope it will help you moving from 2.x to 3.x. I will take time to add examples in the migration page.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.