Weble / ZohoClient

11 stars 7 forks source link

Handle Expired tokens in cache #10

Closed tm1000 closed 3 years ago

tm1000 commented 3 years ago

Handle not returning expired tokens from cache

This is happening in caches that don't support expiring (like Filesystem which im using for testing)

tm1000 commented 3 years ago

Something is still wrong here with how Zoho is operating

A new token says it expires on 1617724764 but then expires_in_sec says 3600. Will have to look deeper

tm1000 commented 3 years ago

Right I remember the issue now. This is why I didn't use The Asad library. Zoho sends back it's token in expires_in_sec in typical zoho form this is not valid according to any specifications. Nor does the Asad library account for this (they probably never had a cache like we do)

The solution for this is to just extend \Asad\OAuth2\Client\AccessToken\ZohoAccessToken and set expires from expires_in_sec