This is my code to check if the password entered by user is correct.
My user is an AzureAD user logged in to a windows 10 Azure AD joined machine.
if (LogonUser(upn., NULL, pwd, LOGON32_LOGON_NETWORK,
LOGON32_PROVIDER_DEFAULT, &token) != 0)
LogonUser fails with error 1326 . Invalid username or password.
But the same in Domain\username format works correctly.
What do I do to get it working when username is in UPN format