Setting up user nightly jobs with unattended access

Guide to setting up unattended nightly jobs using OIDC refresh tokens for data import from Business NXT in web applications.

When using a web application, setting up a nightly job for importing data from Business NXT can be done with the help of OIDC refresh tokens.

Tip

For this kind of scenario, the best approach is to use a service application. To learn more about this see Services.

Only web applications in the Visma Developer Portal can have a refresh token and they require an OIDC-enabled backend to store the refresh token. You will also need to include the offline_access scope for the application.

After checking offline access, you will gain access to more settings related to the refresh token:

GraphQL query in Insomnia

You can create a job user in Visma.net and assign its correct privileges to certain companies and company groups. It can even be your currently logged in user under which the job will run. After loging in with the user under which the unattended job will run, you will need to store this refresh token to refresh tokens and use it after the regular tokens expire, without requiring the user (that the nightly job will run under) to login again.

Tip

See more information about refresh tokens in the Visma Developer Portal documentation.

Last modified September 24, 2024