Enabling OAuth 2 authentication for Microsoft Dynamics 365

       

    Method #1: Enable OAuth 2 authentication for Microsoft Dynamics 365

    Please follow the steps below in order to enable OAuth 2 on your Microsoft Dynamics environment and connect the portal to the Dynamics instance:

    Go to: https://admin.microsoft.com

     

    1. Login with your Dynamics 365 credentials
    2. On the left pane click on Show All
    3. Under Admin Centers click in “All admin centers”
    4. In main screen select “Microsoft Entra”
    5. In the left panelclick on App Registrations
    6. Click on New registration on the toolbar
    7. Enter “Magentrix D365 OAuth 2” for the application name
    8. Select the second option:
      Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant)
    9. Under Redirect URI select “Web” and enter “http://localhost”
    10. Click on “Register” button

      

     

    After saving your app, follow the steps below:

     

    1) Set API Permissions

     

    1. Under Manage click on “API permissions”
    2. Click on “Add a permission” on the toolbar
    3. Select “Dynamics CRM” tile on “Request API permissions” dialog
    4. Select the “Delegated permissions” box, (It gets highlighted in gray when selected).
    5. Enable the user_impersonation checkbox
    6. Click on the Add permissions button

     

    2) Grant Admin Consent

    Click on “Grant admin consent for <company name>” on the toolbar and click “Yes” on the confirmation dialog box.


    3) Update the Manifest

     

    1. Under Manage click on Manifest
    2. Set the isFallbackPublicClient to true
    3. Set the enableIdTokenIssuance to true
    4. Set the enableAccessTokenIssuance to true
    5. Click on Save button in the toolbar

     

    4) Apply the settings to your Magentrix

     

    • Click on Overview in the menu
    • Copy the Application (client) ID by the clicking on the copy button

     

    5) Retrieve the API Endpoint:

    • The API Endpoint URL is the web address you use to access your Dynamics instance. Usually, it is similar to the example below:
      https://*****.crm4.dynamics.com/

    6) Enter the details in the Magentrix Authorization screen.

    • The Authorization link will be provided to you by the Magentrix support team. Once you have completed the steps above, navigate to the link, select Dynamics CRM, select OAUTH, then enter the details in the form and click submit.

     

    Method #2: Enable Client Secret authentication + MFA for Microsoft Dynamics 365

     

    1) Create secret key:

     

    1. Go to: https://admin.microsoft.com
    2. Login with your Dynamics 365 credentials
    3. On the left pane click on Show All
    4. Under Admin Centers click in “All admin centers”
    5. Select “Microsoft Entra”
    6. In the left panel click on App registrations
    7. Select the Magentrix D365 OAuth 2 application you created before (if you don’t see the app, click on All Applications and search for it)
    8. Under Manage click on Certificates & secrets
    9. Click on New client secret on the toolbar
    10. Enter Magentrix D365 Secret in the Description
    11. From Expires dropdown select 24 Months
    12. Click the Add button
    13. Your secret is added. Copy the code under the Value column and keep it in a safe place
    14. Login to https://admin.microsoft.com/
    15. Click on Show all
    16. Click on Power Platform
    17. In the left panel click on Manage
    18. Click on Environments
    19. Click on the environment that is being used in Magentrix (Hover over the link to see the URL. It should match to your Dynamics 365 portal URL)
    20. Click on Settings on the toolbar
    21. Expand Users + permissions
    22. Click on Application users
    23. Click on New app user on the toolbar
    24. Click on Add an app
    25. Select the Magentrix D365 OAuth 2 application
    26. Select the correct Business unit from the dropdown. (This is the first part of your Dynamics 365 portal URL. If you just type the first character, it will show in the suggestion list)
    27. Click the pencil icon for Security roles click
    28. Scroll down and select System Administrator and click on Save button
    29. Click on Create button

    2) Enter the details in the Magentrix Authorization screen:​​​​​

    •  The Authorization link will be provided to you by the Magentrix support team. Once you have completed the steps above, navigate to the link, select Dynamics CRM, select Multi-factor Authentication, then enter the details in the form and click submit.

    • See step 4 (Retrieve the Application ID) and step 5 (Retrieve the API Endpoint) in this article on how to retrieve the necessary information for the Client ID and API Endpoint fields.

         

    « Previous ArticleNext Article »


    3.5 (13)


    Comments

    No records to display

    Subscription
    Follow Knowledge posts
    Please enter your email address to subscribe:

    Email:
    Subscribe