Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Suggested answer

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

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.

Categories:
  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,023 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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

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

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,537 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,520 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans