Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Not Validate User Name & Password

Posted on by Microsoft Employee

I have a function in codeunit as

ValidateCredentials(Domain : Text;Username : Text;Password : Text) : Boolean

UserAccount := UserAccount.PrincipalContext(ContextType.Domain,Domain);
IF UserAccount.ValidateCredentials(Username,Password) THEN BEGIN

User Name and passwords were being authenticated before two days but till now i am not able to login without comment  as


ValidateCredentials(Domain : Text;Username : Text;Password : Text) : Boolean
//UserAccount := UserAccount.PrincipalContext(ContextType.Domain,Domain);
//IF UserAccount.ValidateCredentials(Username,Password) THEN BEGIN

please help me to resolve it.

*This post is locked for comments

  • Suggested answer
    keoma Profile Picture
    keoma 32,675 on at
    RE: Not Validate User Name & Password

    for usage of .net class PrincipalContext follow

    msdn.microsoft.com/.../bb299773.aspx

    msdn.microsoft.com/.../bb341016.aspx

    you should use constructor PrincipalContext(ContextType.Domain, domainname, userName, password) instead, where username/password is a AD service account/user, which has the right to browse the AD.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans