Replies: 1 comment 1 reply
-
It roughly is: $key = InMemory::base64Encoded(
'hiG8DlOKvtih6AxlZn5XKImZ06yu8I3mkOzaJrEuW8yAv8Jnkw330uMt8AEqQ5LB'
);
$token = (new JwtFacade())->issue(
new Sha256(),
$key,
static fn (
Builder $builder,
DateTimeImmutable $issuedAt
): Builder => $builder
->issuedBy('https://api.my-awesome-app.io')
->permittedFor('https://client-app.io')
->expiresAt($issuedAt->modify('+10 minutes'))
)
->toString(); See https://lcobucci-jwt.readthedocs.io/en/latest/quick-start/ While many types may seem superfluous to you, they are in place to prevent getting burnt by basic mistakes. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I wish it was as simple as:
Beta Was this translation helpful? Give feedback.
All reactions