I have a windows credential provider v2 (Windows 10) for add OTP authentication to password login. So after entering the password, the user must enter OTP to login windows.
My problem is that even if the wrong password is entered, the operation continues and after entering the OTP, the user sees the wrong password message.
Is there any way to make sure the password is correct right first and then check OTP?
By this solution this I used the 'LogonUserEx' method in the 'GetSerialization' function, but sometimes I have problems with this. For example, when the user's password expired, this function return false.
if (!LogonUserEx(pszUsername, pszDomain, pszPassword,
LOGON32_LOGON_NETWORK, LOGON32_PROVIDER_WINNT50, NULL, NULL, NULL, NULL, NULL))
{
*pcpgsr = CPGSR_NO_CREDENTIAL_NOT_FINISHED;
SHStrDupW(L"Incorrect User Name or Password! Please try again ...", ppwszOptionalStatusText);
*pcpsiOptionalStatusIcon = CPSI_ERROR;
return hr;
}