Git Product home page Git Product logo

Comments (4)

tylerlong avatar tylerlong commented on June 17, 2024

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.

ashitvora-zz avatar ashitvora-zz commented on June 17, 2024

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.

LingForCC avatar LingForCC commented on June 17, 2024

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.

tylerlong avatar tylerlong commented on June 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.