How to implement a two-factor authentication with windows credential provider during system login

Sachin Jose 61 Reputation points
2023-03-01T18:14:14.9633333+00:00

I am programming a Credential Provider that waits and process a two-factor authentication after primary login. But after GetSerialization() call, the login basically process from the system side, as a result after around 2 minutes timeout windows automatically login and shows desktop. Is there any option to achieve my requirement ?

I am using sample credential samples for the implementation: https://github.com/microsoft/Windows-classic-samples/tree/main/Samples/Win7Samples/security/credentialproviders

My use case defined in the figure:

Question

Windows development Windows API - Win32
Windows for business Windows Client for IT Pros User experience Other
Developer technologies C++
Developer technologies C#
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jeanine Zhang-MSFT 11,356 Reputation points Microsoft External Staff
    2023-03-02T03:01:15.3066667+00:00

    Hello,

    Welcome to Microsoft Q&A!

    As far as I'm concerned, if you want to implement a two-factor authentication, you need implement a credential provider. You could try to ask for sms/pin after the user clicked on the submit button. In the GetSerialization function, you could realize this by creating a new window that ask the sms/pin.

    I suggest you could refer to the links: https://stackoverflow.com/questions/47401427/windows-credential-provider-implementation https://learn.microsoft.com/en-us/windows/win32/secauthn/winlogon-and-credential-providers?redirectedfrom=MSDN

    Thank you.

    Jeanine


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.