edent / Renault-Zoe-API

A basic API for getting information about your Renault Zoe Electric Vehicle.
93 stars 24 forks source link

When does the token expire? #1

Closed edent closed 6 years ago

edent commented 8 years ago

Seems to have a refresh token, but no indication of when it needs to be used.

Certainly expires after 24 hours.

cwimberger commented 7 years ago

I think the best way would be to listen for the ExpiredToken response and refresh the token accoringly.

{
  "code": 403852,
  "message": "com.worldline.renault.myzeonline.exception.InvalidAuthenticationException.ExpiredToken",
  "timestamp": 1481443268063
}

At the moment, I'm trying to find the service call to refresh it.

daniarv commented 7 years ago

Hi,

Have you found any solution to auto refresh the token when it has expired?

I'm trying to show my car status on a local webpage and have the page to refresh every 10 minutes. Maybe that's the reason my token expire too quickly, I have reached the limit of API calls...

Matthew1471 commented 6 years ago

The token is a JSON Web Token (JWT). The expiry value (exp) is in epoch time. You can copy it into https://jwt.io/ and see the expiry date for any given token. I believe the tokens by default expire after 10 hours.

I have an open pull request (#12) to add token support and fix some minor issues :smile:.

edent commented 6 years ago

Closed in #13