My Products
Help
kashyap
PARTNER

URGENT: Visma connect invalid grant after expiration

by kashyap

We are facing issue, Connect app setup with 180days expiration. That means refresh token remain same upto 180 days. After completing 180 days all API getting "invalid_grant". Also entry removed from My details > Access token list.


How can we handle this case without involving end user for reauth everything?

 

 

 

kashyap_0-1734608446408.png

 

6 REPLIES 6

by Oskar Jansson

Hi,

 

If the refresh token has expired, you can request a new refresh token by using a POST request to the /connect/token endpoint.

Please review the “Refreshing Access Tokens” section on the following page:
Connect ecosystem Knowledge Base - Offline Access: Refreshing Access Tokens:  

 

If this does not help, please provide more information, and I will assist you further.

kashyap
PARTNER

by kashyap

This we already following every time but no new refresh token received.

kashyap
PARTNER

by kashyap

Need to check at visma side, I have called connect/token API every 5 minutes  before it getting expire of 1 hour.
No new refresh token get, this found on development and live app both.

This create serious issue of all users who already connected and now they need to re-authorize (consent flow) manually.

 

Michel V
CONTRIBUTOR ***

by Michel V

Had the same issue, use the sliding experation option so you can set the refresh token to unlimited:

MichelV_0-1734710566183.png

 

kashyap
PARTNER

by kashyap

This solution also not works as expected. Upto 24 hours API giving new refresh token on every call. After 24hours it again got invalid.

This means every users need to re authenticate them self again every year.

 

kashyap
PARTNER

by kashyap (Updated ‎20-12-2024 08:53 by kashyap PARTNER )

We already following this.

We are sending

POST request on https://connect.visma.com/connect/token

with headers

Content-Type: application/x-www-form-urlencoded
Accept: application/json
Authorization: Basic base64_encode(client_id:client_secret)

With data
grant_type=refresh_token
refresh_token=current saved refresh token
client_id=app client id
client_secret=app client secret

Every time getting same refresh token. When we get new refresh token after expiration or near to expiration?