OAuth 2.0 Client Credential Grant for Dynamics 365 Business Central
                
                    TESDeveloper                
                
                    Member Posts: 42                
            
                        
            
                    I am attempting to connect to any of the Business Central Web Services via postman using the grant type client_credentials.
I can receive a token from the call below ok:
Images removed as contained sensitive Data.
However, if I attempt to use this token in the call below I receive error 401.
Images removed as contained sensitive Data.
I have the App Registration set up with the following granted permissions:
Images removed as contained sensitive Data.
I also have the Azure Application registered and granted in Business Central.
Any help is appreciated.
Edit: RESOLVED!
The issue was that I was calling the incorrect token URL. This should have been https://login.microsoftonline.com/{tenant ID}/oauth2/v2.0/token
                
                I can receive a token from the call below ok:
Images removed as contained sensitive Data.
However, if I attempt to use this token in the call below I receive error 401.
Images removed as contained sensitive Data.
I have the App Registration set up with the following granted permissions:
Images removed as contained sensitive Data.
I also have the Azure Application registered and granted in Business Central.
Any help is appreciated.
Edit: RESOLVED!
The issue was that I was calling the incorrect token URL. This should have been https://login.microsoftonline.com/{tenant ID}/oauth2/v2.0/token
0                
            Answers
- 
            Hello @TESDeveloper,
I think that the problem is the URL that you are calling, I assume that you are calling a codeunit, so the URL must to be:
https://api.businesscentral.dynamics.com/v2.0/47fe7048-3f97-4ada-b80f-9e03f8a9b48a/Upgrade/ODataV4/ws_Charity_Conta?company='CRONUS%20UK%20Ltd.'0 
Categories
- All Categories
 - 73 General
 - 73 Announcements
 - 66.6K Microsoft Dynamics NAV
 - 18.7K NAV Three Tier
 - 38.4K NAV/Navision Classic Client
 - 3.6K Navision Attain
 - 2.4K Navision Financials
 - 116 Navision DOS
 - 851 Navision e-Commerce
 - 1K NAV Tips & Tricks
 - 772 NAV Dutch speaking only
 - 617 NAV Courses, Exams & Certification
 - 2K Microsoft Dynamics-Other
 - 1.5K Dynamics AX
 - 323 Dynamics CRM
 - 111 Dynamics GP
 - 10 Dynamics SL
 - 1.5K Other
 - 990 SQL General
 - 383 SQL Performance
 - 34 SQL Tips & Tricks
 - 35 Design Patterns (General & Best Practices)
 - 1 Architectural Patterns
 - 10 Design Patterns
 - 5 Implementation Patterns
 - 53 3rd Party Products, Services & Events
 - 1.6K General
 - 1.1K General Chat
 - 1.6K Website
 - 83 Testing
 - 1.2K Download section
 - 23 How Tos section
 - 252 Feedback
 - 12 NAV TechDays 2013 Sessions
 - 13 NAV TechDays 2012 Sessions
 
