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

OAuth access token expires every hour and we need to increase the access token's lifetime to expose ODATA URL( Webservice API)

(0) ShareShare
ReportReport
Posted on by 112

OAuth access token expires every hour and we need to increase the access token's lifetime to expose ODATA URL( Webservice API).

Steps followed,

Step1 : Registered a new app in Azure Portal.

Step 2: Authentication -> Web -> Added "Redirect URI" (https://businesscentral.dynamics.com/)

Step 3: Added App Permissions (Both Delegated and Application Permissions).

Step 4 : Added Client Secret.

Step 5: In BC, created an Azure Active Directory application with the same name of registered app from Azure portal.

Step 6: Added User Groups for this Azure AD application such that the User Permission set has been updated.

Step 7: Enabled the Azure AD Application. 

Step 8: After configuring the app and Azure AD Application, created new GET request in Postman app.

Step 9: Parameters required for OAuth 2.0 are passed in Postman app,

Parameters are,

Token Name, Grant Type, Access Token URL, Client ID, Client Secret, Scope, Client Authentication

Step 10: Generated new Access Token and using the token, I am able to get the data from the Webservice API.

Issue is, We have provided the ODATA URLs to expose the Webservice API to Java team in our organization such that the webservice key is going to be removed.

So we have provided the OAuth access token generated via Postman app to them. They are unable to use the same token after an hour since it expires.

Is there any way to set the expiry time of OAuth token ? Or is there any work around to access the Web Service API without Web service key.

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,248 Moderator on at
    RE: OAuth access token expires every hour and we need to increase the access token's lifetime to expose ODATA URL( Webservice API)

    Hi,

    Token expiry decided by Azure AAD, please refer the below link

    learn.microsoft.com/.../active-directory-configurable-token-lifetimes

    learn.microsoft.com/.../how-to-change-token-expiration-time-in-azure-porta.html

  • Suggested answer
    Andy Sather Profile Picture
    Andy Sather on at
    RE: OAuth access token expires every hour and we need to increase the access token's lifetime to expose ODATA URL( Webservice API)

    Hello,

    If you don't get further responses to this issue, you may want to raise a support request to Microsoft support via your CSP / Partner.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,468 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,287 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans