Comments (4)
The refresh token was valid at the time you got it. But later it expired. You should always remember to refresh it before it expires.
By the way, if you refresh it successfully, a new refresh token is returned and the current one expires automatically, so please remember to save the latest payload every time you refresh the token.
from ringcentral-php.
So if user authenticates today and if I dont make any request for next 24 hrs, I have to ask user to authenticate again (since I can not use access token or refresh token to get new access token).
In that case, I can do nothing if user does not explicitly take any action.
Is it? Or am I missing something here?
from ringcentral-php.
Yes. You are right. If user takes no actions, the refresh token will be expired in the end. You need to ask user to re-login. Another option is to refresh the token in regular time span explicitly in your application.
BTW, according to the payload you pasted above, refresh token will be expired in 7 days.
from ringcentral-php.
In that case, I can do nothing if user does not explicitly take any action.
That's not true. You can setup a cron job to refresh the tokens. refresh_token expires in 7 days, so you need to run the cron job at least once per week.
And there is something tricky you should be aware of: https://github.com/ringcentral/ringcentral-php/blob/master/src/Platform/Platform.php#L237 According to the source code, sometimes the sdk refreshes the token for you. If this happens, you'd have to save the new payload because the old one just expires. I think this is the root cause of the issue you posted.
In the C# Client, there is a token refresh event so programers can easily save the latest payload taking advantages of the listener design pattern. But there isn't such thing in this PHP SDK. @anilkumarbp @kirill-konshin @grokify Please advise.
from ringcentral-php.
Related Issues (20)
- PHPOption deprecation warning
- 400 Bad Request (and additional error happened during JSON parse: Response is not JSON)
- FatalError: Unparenthesized `a ? b : c ? d : e` is not supported HOT 2
- php 7.4 Ternary Operator Issue HOT 1
- Undefined array key "code_challenge" HOT 1
- Issue with PHP version 7.4
- telephony webhook end
- Do not specify default "Accept" header HOT 1
- Upgrade PubNub dependency HOT 4
- Root package 'ringcentral/ringcentral-php' cannot require itself in its composer.json
- Pagination issues on teams
- Consider using phar bundler
- Packagist is not auto-updating this package HOT 1
- After a while, notifications stop arriving
- Symfony/event-dispatcher 5.1.0 not compatible HOT 1
- Whitesource CVE-2020-28032
- Face issue while sending the mms with image.
- trying to filter extension list results in an error with urlencode()
- Client error: `POST https://platform.devtest.ringcentral.com/restapi/oauth/token` resulted in a 400 Bad Request HOT 1
- Composer error: incompatible with guzzlehttp/psr7 2.x+ HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ringcentral-php.