Does CredUIPromptForCredentials retrieve stored password?



Hi,

I'm not sure I fully understand the behaviour of CredUIPromptForCredentials
when working with generic credentials.

What I'm after is to only show the dialog if there are no stored credentials
or if the stored credentials fail to authenticate.

For the first call to CredUIPromptForCredentials I'm using the following
flags: CREDUI_FLAGS_GENERIC_CREDENTIALS, CREDUI_FLAGS_EXPECT_CONFIRMATION and
CREDUI_FLAGS_SHOW_SAVE_CHECK_BOX. Then I want to authenticate and then call
CredUIConfirmCredentials. If the authentication fails I would call
CredUIPromptForCredentials again but with CREDUI_FLAGS_ALWAYS_SHOW_UI set as
well.

What happens is that I get a login dialog if there are no stored credentials
and the function returns without showing a dialog if there are stored
credentials. So far so good. What I was hoping for in the latter case was
that the stored password would be returned but that doesn't seem to be the
case - I just get back whatever I passed in.

This doesn't seem to be very useful as there doesn't seem to be any way for
the caller to tell whether the dialog was shown or not. The only way I can
think of using it is to use the lower level CredRead call to get the password
before invoking CredUIPromptForCredentials, at which point I already know
whether there were stored credentials.

Am I missing something here?

Regards,

Phil
.



Relevant Pages

  • Re: CredUIConfirmCredentials behaves unexpectedly
    ... CredUIPromptForCredentials call) - I blogged my solution at ... What is even more confusing is that the new credentials ... >> Alan Dean ...
    (microsoft.public.dotnet.security)
  • Re: CredUIPromptForCredentials
    ... It will allow you to get smart card credentials and password credentials in ... mechanisms for biometric authentication in currently released operation ... CredUIPromptForCredentials looks like a suitable function. ...
    (microsoft.public.win32.programmer.kernel)
  • CredUIPromptForCredentials returns ERROR_INVALID_PARAMETER?
    ... credentials, but it returned ERROR_INVALID_PARAMETER. ... change parameters? ... I changed flags and CredUIPromptForCredentials didn't complains again, ... DWORD dwErr = CredUIPromptForCredentials( ...
    (microsoft.public.vc.mfc)
  • CredUIPromptForCredentials returns ERROR_INVALID_PARAMETER?
    ... credentials, but it returned ERROR_INVALID_PARAMETER. ... change parameters? ... I changed flags and CredUIPromptForCredentials didn't complains again, ... DWORD dwErr = CredUIPromptForCredentials( ...
    (microsoft.public.win32.programmer.kernel)
  • CredUIPromptForCredentials returns ERROR_INVALID_PARAMETER?
    ... credentials, but it returned ERROR_INVALID_PARAMETER. ... change parameters? ... I changed flags and CredUIPromptForCredentials didn't complains again, ... DWORD dwErr = CredUIPromptForCredentials( ...
    (microsoft.public.platformsdk.security)

Loading