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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Suggested Answer

How to validate the user credentials (username & password) in D365

(0) ShareShare
ReportReport
Posted on by 5

Hi Team,

I am trying to validate user with username and password in D365 X++ code.

I tried the validatePassword() method but it always return false.

Tried Code:

str userName = "avinash.patil@domain.com";

str userPassword = "password";

UserInfo                         userInfo =  xUserInfo::find(false, userName);
AxaptaUserManager   axUserManager  = new AxaptaUserManager();

 if (!axUserManager.validatePassword(userInfo.networkAlias, userInfo.networkDomain, userPassword))
 {
           return "Invalid Password";
 }

Not sure whats wrong in above code, but If there is any other option available please let me know.

Thanks In Advance

Avinash Patil

I have the same question (0)
  • Martin Dráb Profile Picture
    237,803 Most Valuable Professional on at

    D365FO doesn't authenticate users at all - it uses authorization claims provided by Azure Active Directory (AAD). If you really have to do something like that, you'll have to talk to AAD too.

    Nevertheless it's highly unusual. What exact business requirement are you dealing with?

  • Shabbir Profile Picture
    240 on at

    As Martin said, the user authentication mechanism is changed in FinOps now.

    Please have a look at sample project, specially the AuthenticationUtility project where code is placed to authenticate with Azure Active directory.

    github.com/.../Dynamics-AX-Integration

  • Avinash3484 Profile Picture
    5 on at

    Thanks Martin,

    I am connecting D365 through custom service with Handheld Device. As you mentioned I established the connection with authorization claims (Client Id & Secret) for first connectivity but after that I want to make sure that user who connecting it should have valid login credentials of D365 by entering username and password through Handheld Device.

    Please let me know if there is any way to do that.

    Thanks

    Avinash  

  • Suggested answer
    Martin Dráb Profile Picture
    237,803 Most Valuable Professional on at

    As I said, D365FO doesn't manage such information.

    If you want to use user's username and password, why don't you simply authenticate via username and password of the client secret when creating the connection? Just note that than you have to register the application in AAD as a native app.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Siv Sagar Profile Picture

Siv Sagar 266 Super User 2025 Season 2

#2
Laurens vd Tang Profile Picture

Laurens vd Tang 213 Super User 2025 Season 2

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 140 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans