Posts

Showing posts from October, 2020

Connect to Dynamics 365 Common Data Service with OAuth 2.0

Image
Recently, I had a requirement to connect to CDS using OAuth 2.0 so that an AAD token can be generated without having to prompt a user for sign in. I have listed out the steps below to achieve this. App Registration Login to azure portal . Navigate to 'Azure Active Directory' > 'App registrations' > 'New registration' Enter the name of the app register and click 'Register' to create a new app registration Open 'API permissions' within the app registration, click 'Add a permissions' and choose 'Dynamics CRM' Select 'Delegated permissions', check 'user_impersonation' and click 'Add permission' Click 'Grant admin consent' Navigate to 'Certificates & secrets' and generate a 'New client secret'. Keep a copy of the client secret.  Navigate to overview and copy the 'Client Id/Application Id' Click Endpoints and copy the 'OAuth 2.0 token endpoint' Common Data Service...