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

 

12 REPLIES 12
kashyap
PARTNER

by kashyap

We have created a service app to resolve the refresh token issue. We are not able to access Visma Nxt services using service app.
Which other application supported in service app Dinero, E-conomic, E-accounting etc

by Oskar Jansson

Could you explain a bit more about what you're trying to do? Maybe provide a screenshot, so I can assist you more effectively.

kashyap
PARTNER

by kashyap

As of now we have issue of refresh token getting expired after 180 or 365days. Due to this users need to re-setup everything into the system. This make too much issue for users to remember the days. So we have created a service app to avoid refresh token issue.

 

We have added "Business NXT GraphQL Service API" in the service app. But while authorizing the service app it never asked for Nxt permissions also we are not able to access NXT APIs after authenticating.

So by looking at refresh token issue we have planned to shift all visma application from "Web" type of application to "Service" type application. As of now we have Visma e-Accounting, Visma NET, Visma NXT, Dinero (in progress), Visma E-conomic(in progress).

Can you please help guide me to have proper solution?


by Oskar Jansson

It is recommended to follow these courses when setting up your Business NXT application. Have you taken these courses when setting up the applications?

 

Business NXT GraphQL API Integration courses

 

If so, at which step is this problem occurring?

kashyap
PARTNER

by kashyap

This we already we followed but how we can create service app for Visma Nxt.

by Oskar Jansson

Could you please send a screenshot of the step you're at in creating the service app? Without a more precise part of the process, it will be difficult to troubleshoot.

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?