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

ttl seems to be set to null in a created token request? #46

Open
SimonWoolf opened this issue Jul 18, 2017 · 1 comment
Open

ttl seems to be set to null in a created token request? #46

SimonWoolf opened this issue Jul 18, 2017 · 1 comment
Labels
bug Something isn't working. It's clear that this does need to be fixed.

Comments

@SimonWoolf
Copy link
Member

SimonWoolf commented Jul 18, 2017

https://app.intercom.io/a/apps/ua39m1ld/respond/inbox/all/conversations/10861930672

Not sure if this is a bug in ably-php, ably-js, or somewhere inbetween. Can't really see how it could be any of them, to be honest, there doesn't seem room for anything to go wrong in any of the stages that I can see. But it must be going wrong somewhere.

Customer creating token request in php with

$token = $this->ably->auth->createTokenRequest([
  'ttl' => 86400000,
  'capability'=> [ $channel => $capabilities],
  'clientId' => 'customer-'.$user->getId()
]);

By the time it gets to ably-js, it looks like:
{"ttl":null,"capability":"{\"redacted:*\":[\"subscribe\",\"history\"]}","clientId":"customer-38","timestamp":"1500420264269","keyName":"<redacted>","nonce":"6b8c0f7b37bf2d100fa210204f8d80ad","mac":"oAsynffIX9glVWpJcmNlDpgvZx9dMCNF3dctiLk1VGM="}

With the ttl being null. This results in the mac being incorrect, as the ttl was 86400000 at the time the mac was signed -- which I've confirmed by getting the mac to match if I force it to be that manually.

┆Issue is synchronized with this Jira Bug by Unito

@SimonWoolf
Copy link
Member Author

Reply from customer about how he's serializing the token request:

I use symfony so it uses the JMSSerializer Bundle to serialize the json. I created a custom entity as JMSSerializer converts camelCase to underscore case by default so I needed to use a custom entity so that this would not happen

Will follow up on whether it's possible that that might remove the ttl

@sync-by-unito sync-by-unito bot added the bug Something isn't working. It's clear that this does need to be fixed. label Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working. It's clear that this does need to be fixed.
Development

No branches or pull requests

1 participant