OAuth2 and Business Central
The web services key that is currently used to connect Business Central endpoints to data from Business Central is being depreciated and replaced by OAuth2. In this post, we will walk you through setting up OAuth2 within Business Central to prepare you for that switch.
Just follow these steps:
1. Login to your Azure portal and go to Azure Active Directory
2. Go to App registrations and click on New registration
3. Enter a name and put in the redirect URL of https://businesscentral.dynamics.com
4. Click on Register
5. Click on API permissions after the App is registered
6. Click Add a permission
7. Select Dynamics 365 Business Central
8. Click on Delegated permissions
9. Put a checkmark in User_impersonation and Financial.ReadWriteAll
10. Click on application permissions and put a checkmark in all of the boxes
11. Click on Add permissions
12. May need to then click on Grant admin consent for your tenant
13. Click on Certificates & Secrets on the right-hand menu
14. Click on new client secret
15. Provide a desc and expiry date
16. Click Add
17. Make a note of the Value and Secret ID and copy to notepad as these are required
18. Click on Overview in the top right navigation and make note of the application (Client) ID and add that to your notepad file as well.
You are now ready to use OAuth2 in API calls.