2

I am trying to develop a custom credential provider. Trying to learn the basics. I implemented ICredentialProvider and ICredentialProviderCredential.

I added a custom credential tile, edit text and command link to windows logon UI.

  1. What i want to do is, when i click on CommandButton i try to read textbox value but i could not do that.

  2. I want to open a custom windows form (e.g MFA form), how can i open a custom form?

I am using phaetto/windows-credentials-provider implementation as example

There is not much information about this topic.

candogg
  • 145
  • 7
  • Does the answer to [this question](https://stackoverflow.com/questions/36425318/windows-credential-provider-in-c-sharp) solve your problem? – Rufus L Jan 12 '23 at 19:43
  • No, I added a text box on Windows logon UI. I am trying to read its value when i press a command link. I log every method to EventViewer. Command button click is working, but i cannot get value of the text box. Second, I want to open a form on Windows logon UI. These are my questions. I didn't provide a code because its basic credential provider implementation. – candogg Jan 12 '23 at 19:48
  • I already implemented a basic credential provider. That question does not solve my problem. I explained my problem above. – candogg Jan 12 '23 at 19:50
  • 1
    You must collect the value of text box field as far as it is updated and your tile implementation class is notified about the change of the value. You will be notified about every single character user entered into the text field. Be ready for this. – Alexander Jan 13 '23 at 20:17
  • 1
    If you want to open any window you must acquire a handle of parent window. – Alexander Jan 13 '23 at 20:21
  • 1
    Handle acquisition method is `icredentialprovidercredentialevents::OnCreatingWindow`. As far as user type info input text box your provider will be called `ICredentialProviderCredential::SetStringValue` method. – Alexander Jan 13 '23 at 20:37
  • Have a look at this anwer and it's comments. https://stackoverflow.com/a/52089207/3868464 – Alexander Jan 15 '23 at 15:38

1 Answers1

2

1. Text field

You must collect and keep securely the value(s) of text box(ex) field(s) as far as it is updated and your tile implementation class is notified about the change of that value.
You will be notified about every single character user entered into the text field. Be ready for this.

As far as user type info input text box your provider's method ICredentialProviderCredential::SetStringValue will be called on every text box update.

2. Popup window (dialog)

If you want to open any window you must acquire a parent window handle from Logon UI / Cred UI. Handle acquisition method is ICredentialProviderCredentialEvents::OnCreatingWindow.

You can find more details in the answer and it's comments: https://stackoverflow.com/a/52089207/3868464 .

Alexander
  • 1,232
  • 1
  • 15
  • 24