Server to Server OAuth Authentication with KingswaySoft and Dynamics 365
KingswaySoft is one of the best tools that saves a lot of time, easy to use and is very efficient when building migrations/ integrations with Dynamics 365 using SSIS. It's one of the tools that's well maintained and has frequent updates to accommodate for rapid changes in Dynamics 365 .
Let's see how we could authenticate to Dynamics using OAuth with Client Credentials(Server to Server) using KingswaySoft.
Let's start by registering an App in Azure AD
For the redirect URI, it needs to be a valid URI
Now that we have registered our App, let's set the Permissions for it to Access Dynamics365 as a delegated user.
After adding the permission we should now see it being added under the Required permissions
At this point we just need the Client Id/App Id and a client secret.
We could get the App Id by navigating to the App registration we have created
Now create a secret key for the application. Ideally we could be storing this in the Azure Keyvault and reference it from our application but in this case we will just use it as an environment variable in our SSIS package.
Now let's create the Application User in Dynamics 365 under the below view and set the UserName and App Id. This will create a Azure Object Id. Make sure to assign an appropriate security role for this user.
After the Application user is created and a security role is assigned, we are now good to test it with the Kingswaysoft Connection manager.
Let's define the Client App Id, Secret and the Org URL as parameters on the SSIS Project.
In the KWS connection manager, let parameterize the connection parameters
And now finally when we test, we should be able to connect to Dynamics 365
Hope you found this helpful:)