Hi RingCentral Team,
I’m facing a refresh token issue using the RingCentral PHP SDK (v2.3.1) in a Laravel application. The refresh token call fails with “Refresh token has expired”, even though the access token is still valid and well within its expiration window.
What makes this confusing is that the official RingCentral Web Phone Demo (https://developers.ringcentral.com/demo.html), using the same RingCentral account, same app, and same environment, stays authenticated for weeks without any issues.
🔍 Issue Summary
-
Access token validity: 1 hour
-
Refresh token validity: 7 days (604800 seconds)
-
Observed behavior:
-
Refresh token fails even when attempted within minutes of issuance
-
Error thrown by SDK:
Refresh token has expired
-
-
Expected behavior:
-
Refresh token should remain valid for days, not minutes
-
🧪 Environment Details
Laravel App
-
PHP 8.1
-
Laravel 10.x
-
RingCentral PHP SDK: 2.3.1
-
cURL: 7.68
-
OS: Ubuntu 20.04
-
Environment: Real Number with old developer acoount
Web Phone Demo
-
Same RingCentral app
-
Same credentials
-
Same Sandbox environment
-
Remains signed in for weeks
🔁 Reproduction Steps
-
Authenticate successfully and receive access + refresh tokens.
-
Attempt refresh via
$platform->refresh():-
Even before access token expiration
-
Or with forced refresh
-
-
SDK throws:
“Refresh token has expired” -
Meanwhile, the Web Phone Demo using the same account continues working normally.
📜 Logs (Excerpt)
-
Refresh token expiration returned by API: 7 days
-
Refresh attempted within minutes
-
SDK still reports refresh token as expired
This suggests either:
-
A PHP SDK issue
-
Token invalidation due to SDK auth state handling
-
Or a difference in how Web SDK vs PHP SDK handles refresh tokens
❓ Questions for the Community
-
Has anyone encountered refresh token expiring prematurely with the PHP SDK?
-
Is there any known issue with SDK 2.3.1?
-
Is calling
$platform->auth()->setData()before refresh still the recommended approach? -
Are refresh tokens invalidated when multiple platform instances are created?
Any insight from RingCentral engineers or fellow developers would be greatly appreciated. I can provide full logs or a minimal reproduction if needed.
Thanks in advance 🙏
Muhammad Faisal Qasim