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

expiresAt() sets a floating point value #693

Closed
stefanplk3 opened this issue Feb 24, 2021 · 2 comments
Closed

expiresAt() sets a floating point value #693

stefanplk3 opened this issue Feb 24, 2021 · 2 comments
Assignees

Comments

@stefanplk3
Copy link

stefanplk3 commented Feb 24, 2021

    $token = $config->builder()
        ->issuedBy('xy') // iss
        ->permittedFor('xy') // aud
        ->relatedTo('xy') // sub
        ->withClaim('room', '*')
        ->expiresAt($now)
        ->withHeader('kid', 'xy')
        ->getToken($config->signer(), $config->signingKey());

$token->toString() now has a floating point value in the "exp" field:

eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImtpZCI6Inh5In0.eyJpc3MiOiJ4eSIsImF1ZCI6Inh5Iiwic3ViIjoieHkiLCJyb29tIjoiKiIsImV4cCI6IjE2MTQxODI0MTIuMTI1NzgwIn0.oocn8Wg3RB8bGPeLNEPDkis9YwWPRIuNxxlXI2m3so8

{
"iss": "xy",
"aud": "xy",
"sub": "xy",
"room": "*",
"exp": "1614182412.125780"
}

@stefanplk3 stefanplk3 changed the title expiresat expiresAt() sets a floating point value Feb 24, 2021
@lcobucci lcobucci self-assigned this Feb 24, 2021
@lcobucci
Copy link
Owner

Duplicate of #618

Also take a look at #623

@lcobucci
Copy link
Owner

Hello folks, thanks to @yassinrais we managed to fix this compatibility issue whilst still preserving the microseconds precision. We already released new versions to solve the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants