web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Connecting to D365 Finance and Operations from A Windows Forms Application using MSAL

(0) ShareShare
ReportReport
Posted on by 10

Hello,

I am trying to connect a Windows Forms Desktop application to D365 Finance using MSAL. While I found several references addressing this task, none of the projects could be compiled "as is".

The most details explanation was given at  https://community.dynamics.com/ax/b/axinthefield/posts/move-to-the-newer-microsoft-authentication-library-msal-to-acquire-a-token-for-your-integrations. However,  the code in this example failed to compile due to several errors.

Does anyone have a sample code, the most basic one, showing how to connect to D365 using Client ID and secret?

I have the same question (0)
  • Suggested answer
    WillWU Profile Picture
    22,363 on at

    Hi Alexander1111,

    Could you provide more details about what you have done and what error message you got.

    And you could check the github: github.com/.../Dynamics-AX-Integration

    There is sample code to get authenticate token, please check if it helps.

  • Alexander1111 Profile Picture
    10 on at

    Hi Will,

    Thank you for the link and your help.

    The example at Dynamics-AX-Integration refers to the ADAL authentication library Microsoft.IdentityModel.Clients.ActiveDirectory. MS will stop supporting ADAL authentication in June 22. I would prefer to find an example for MSAL authentication.

    So far:

    * I registered a new application on my domain and generated Client ID, secret and the rest of the fields;

    * The client company registered my email as System Admin on their domain;

    * I could not register the application on the client company domain because I don't have permissions, even though I am System Admin;

    * I could not find any example of the MSAL-based authentication code using library Microsoft.Identity.Client that could be compiled after downloading.

    Any advice will be greatly appreciated.

    Regards,

    Alexander

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 591

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 550 Super User 2026 Season 1

#3
Abhilash Warrier Profile Picture

Abhilash Warrier 543 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans