Select Page

How smart card logon works

How smart card logon works


In this blog post, I will be talking about how smart card logon works, and why I think it is better in terms of security. Smart cards are not a new thing. They appeared long time ago, as a second factor authentication to enhance the overall security. People use smart cards to encrypt information or to for digital signatures. What is interesting though is the ability to log on to a Windows machine using smart cards. After all, smart cards contain digital certificates that are issued by a certificate authority. That certificate authority is supposed to be a trusted service inside the network. Meanwhile, Active Directory is the trusted identity store that manages computer and user accounts, and enable the use of Kerberos to enable secure access to resources.

So the tricky question is how a digital certificate inside a smart card, can authenticate a user during the logon experience, to Active Directory? In other words, how smart card logon works?

In order to understand the terms used in this blog post, let us agree on couple of terms. KDC stands for Key Distribution Service, and it is running on each domain controller. Domain Controllers are the server role that represents Active Directory service. “Active Directory”, “KDC”, and “domain controller”, all mean the same thing.

Kerberos is the authentication protocol when a user log on interactively to a domain joined machine. Each domain joined machine has a secret that is only known to itself and to the KDC. This secret key is used to create a secure channel between the machine and the KDC. This channel is important, because logon requests for users are passed through this channel to the domain controller.

How Normal Password type logon happens ?

I want to give you a brief introduction on how normal logon works using passwords, before jumping to smart card logon.When a user attempts to logon to a workstation, the workstation sends a request to the KDC. KDC generates a TGT (Ticket Granting Ticket) and encrypts it with a key (Ku). This Key (Ku) is derived from the hash of the user password, and only the user and the KDC know about this key. The workstation asks the user for a password, derive the hash of the password to get (Ku) and then decrypt the TGT.

Why Password Logon is not good ?

In this protocol, (Ku) is exposed to two parties, the user and the workstation. A key memorized by the user can be vulnerable because he can tell it to another user or (Shoulder Surf) it when he type it. Further more, her keystrokes may be snooped remotely without her knowledge.

A key in a workstation can be vulnerable if the workstation is not securely protected or cannot be trusted .If someone can scan the entire memory, he can obtain the key. If someone has admin access to the workstation, he can install logon program to store user password.

To solve those issues , it is preferable to decrypt the TGT outside the workstation.Therefore an external encryption device is required. Furthermore , user passwords are weak by nature, and are subjective to dictionary attacks, and can be shared between multiple users.

To overcome those limitations, you can use a smart card logon instead of password logon to better enhance the overall security of your logon experience. In the next section, I will explain how smart card logon works in details.

How Smart Card logon happens ?

In order for smart card logon to work, the domain controller should have a digital certificate by itself. Each domain controller participating in smart card logon, should have a digital certificate on its certificate store. Here is how smart card logon works:

  • If a reader is attached to the user’s machine, the user is prompted to put in a card.
  • Then the user is prompted to enter a pin.
  • The logon request is passed to the Local Security Authority (LSA).
  • LSA communicates with the Kerberos authentication package on the client.
  • Kerberos sends a request to the Kerberos Distribution Center (KDC) on the domain controller for authentication. The request includes a copy of the x.509 certificate (from the smart card) in the pre-authentication data field of the request and is signed by the private key.
  • The KDC builds a certification path from the certificate to a root CA in the system root store.
  • There must be an enterprise Certification Authority (CA, published in Active Directory). This prevents a rogue CA certified in another CA hierarchy from issuing a certificate in the domain.
  • The KDC uses the public key from the certificate to verify the signature.
  • KDC verifies the timestamp is within skew time, the time period during which a request can be processed. This helps to detect a replay attack.
  • KDC looks in the AD for account information.
  • If all tests are passed, the KDC returns a Ticket Granting Ticket (TGT). The KDC provides a copy of its certificate as well and signs the returned information with its private key.
  • The client verifies the KDC by building a certificate path from the certificate to the trusted root CA and uses the KDC public key to verify the reply signature.
  • If all is OK, the normal Kerberos path is followed from here (the TGT is used to get a service ticket and hence to the user’s desktop).

About The Author

Ammar Hasayen

Ammar is a digital transformer, cloud architect, public speaker and blogger. He is considered a trusted advisory with the ability to quickly navigate complex multi-cultural organizations and continuously improve and motivate cross-functional teams to achieve higher productivity, collaboration, revenue gain and cross-group knowledge sharing. His contributions to the tech community helped him get awarded the Microsoft Most Valuable Professional. Ammar appears in a lot of global conferences, and he has many publications about digital transformation and next generation technologies.

1 Comment

  1. Joe Richards

    Hi Ammar, this is the best article I have seen on this topic so far, even after asking our onsite MSFT people to get me deep details on how smartcard auth works. I do have a question though… Are there deeper details on this bit “KDC looks in the AD for account information.” Specifically how is it looking the user up? I expect it is like normal kerberos auth and is a search for the user UPN/sAMAccountName? Is that correct or is it something else? Since the only change on the user objects is the presence of userAccountControl flag value SMARTCARD_REQUIRED I cannot visualize what else it would be but would rather know for sure than just go off my guess. 🙂



Leave a reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Hi, I’m Ammar Hasayen


About Me

Cloud Architect | Cybersecurity | CISSP | Microsoft MVP | Pluralsight Author | Book Author | International Speaker | World Explorer | @ammarhasayen


LinkedIn Profile

My Pluralsight Course

Speaking at Microsoft Ignite Dubai

Ammar Hasayen Speaker Ignite

Pin It on Pinterest