Imagine you have an external system pushing some customer data to your Dynamics 365 environment overnight and sometimes it requires longer than an hour throwing a 401 error. In this article, I’ll describe how you can extend the lifetime of the access token used to connect to the Microsoft Dataverse API in order to resolve this issue easily.
In this example, I use the OAuth 2.0 client credentials flow, where we have created an application user in our Microsoft Dataverse environment.
Application users are connected to an Azure application that has been previously registered and it provides us with the corresponding client credentias (e.g. client ID and secret)
You can learn how to create a new application user in this article.
Using Postman, we can test our application user simulating the integration I mentioned at the beginning of the article.
Notice the default access tokenlifetime
View original post 425 more words