I've been trying to access the Dynamics 365 API in a Sharepoint Online Webpart for days. I have already registered the app in Azure, I also get an access token when I call the request with Client ID and Client Secret via Insomnia/Postman. Nevertheless I get a 401 Unauthorized Error all the time. When I enter the same endpoint in the browser with a logged in Office 365 user, I get the correct answer from Dynamics CRM.
I would prefer it if Sharepoint recognizes the Office 365 user and if this user has access to Dynamics CRM the content is displayed.
How would I be able to do this?