web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

How to get a refresh token from Oauth2 login?

(0) ShareShare
ReportReport
Posted on by 25

I'm successfully using the Dynamics Business Central APIs to create and update content but my issue is that when I authorize my app using Oauth2 I'm not getting a refresh token to renew my access token. Given that the access token has a relatively short life it's somewhat cumbersome to have to keep logging in.


This is the url I'm using to get the code:-

    login.microsoftonline.com/.../authorize


And then this URL to exchange the code for an access token


    login.microsoftonline.com/.../token


And this is the result that I get which as you can see has no refresh token


{"token_type":"Bearer",
"scope":"api.businesscentral.dynamics.com/Financials.ReadWrite.All api.businesscentral.dynamics.com/SmartListDesigner.ReadWrite.All api.businesscentral.dynamics.com/user_impersonation ">api.businesscentral.dynamics.com/.default",
"expires_in":3599,
"ext_expires_in":3599,
"access_token":"12232 ..blah..blah...d3s"}

Is there a way to make the authorization process provide a refresh token so that my users don't have to keep logging in?

I have the same question (0)
  • Suggested answer
    Marco Mels Profile Picture
    on at

    Hello,

    You may want to have a look here:

    github.com/.../52896

    Apart from that, we currently do not have dedicated Dev support via the Dynamics 365 Business Central forums, but I wanted to provide you some additional resources to assist.  If you need assistance with debugging or coding I would recommend discussing this on one of our communities.

    www.yammer.com/dynamicsnavdev

    dynamicsuser.net/.../developers

    I will open this up to the community in case they have something to add.

    Thanks.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,010

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,270 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,085 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans