> ## Documentation Index
> Fetch the complete documentation index at: https://help.allthenticate.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configure AD CS for Allthenticate certificate logon

> Create the smart card logon template, issue the enrollment agent certificate, and set up web enrollment (CES) or native enrollment (WCCE) on your AD CS CA.

Allthenticate certificates for domain accounts come from your own Enterprise CA. The enrollment agent certificate lets the Domain Controller Bridge request certificates on behalf of users. A CA administrator can do all of this before the implementation call.

You need an Enterprise CA in the domain (a dedicated subordinate CA works) and access to the **Certification Authority** and **Certificate Templates** consoles. If you don't have a CA yet, see Microsoft's [AD CS documentation](https://learn.microsoft.com/en-us/windows-server/identity/ad-cs/). Make sure the CA's CRL and OCSP URLs are reachable from the domain controllers and the computers.

## Create the certificate template

In the **Certificate Templates Console**, duplicate the built-in **Smartcard Logon** template and set the following on the duplicate. Anything not listed keeps the value inherited from **Smartcard Logon**.

> [!WARNING]
>
> **Record the template name, not the display name.** The **General** tab shows both. The **Template name** is generated from the display name without spaces and can't be changed after you save. It's the value you enter in the Certificate Generation Policy; the display name there causes `Certificate template not found on the CA`.

| Tab | Setting | Value | Why |
| - | - | - | - |
| General | Template display name | Your choice, for example `Allthenticate Smartcard Logon` | |
| General | Validity period | Your policy, typically one year, and well above 45 days | Allthenticate renews when fewer than 45 days remain. A validity of 45 days or less counts as already expired, so users are re-enrolled every few minutes. |
| Compatibility | Certification Authority | **Windows Server 2012** or later | Makes the **Key Storage Provider** and ECDH options appear. Set both compatibility values before you open **Cryptography**. |
| Compatibility | Certificate recipient | **Windows 8 / Windows Server 2012** or later | Same as above. |
| Request Handling | Purpose | **Signature and encryption** | Required for the key agreement usage below. Leave **Allow private key to be exported** cleared: the key is created on the phone and never leaves it. |
| Cryptography | Provider Category | **Key Storage Provider** | Required for ECDH. |
| Cryptography | Algorithm name | **ECDH\_P521** | Keys are on the NIST P-521 curve. |
| Cryptography | Minimum key size | **521** | |
| Cryptography | Request hash | **SHA256** | Requests are signed with ECDSA with SHA-256. |
| Cryptography | Providers | **Requests can use any provider available on the subject's computer** | The desktop app's provider, `Allthenticate Key Storage Provider <version>`, changes name with releases. |
| Subject Name | Subject name format | **Build from this Active Directory information** | Requests carry no subject, so only this makes the CA fill in the name. **Supply in the request** is also a security hazard. |
| Subject Name | Alternate subject name | **User principal name (UPN)** | Windows maps the certificate to the account by UPN. |
| Issuance Requirements | CA certificate manager approval | **Cleared** | The bridge can't collect a pended certificate. |
| Issuance Requirements | This number of authorized signatures | **1**, policy type **Application policy**, application policy **Certificate Request Agent** | Lets the enrollment agent enroll on behalf of users. |
| Extensions | Key Usage | **Digital signature** and **Allow key exchange without key encryption (key agreement)**; no key encipherment | Key agreement lets Windows cache the sign-in so users can sign in while no domain controller is reachable. Without it, sign-in works only online. Certificates issued before you add it need **Mark for reissue** and one online sign-in per computer. |
| Extensions | Application Policies | Smart Card Logon and Client Authentication (inherited) | Keep both. |
| Security | Enroll | Allow for the Active Directory security group of the users who get certificates. With WCCE, also **Read** and **Enroll** for the bridge's run-as account. | The bridge requests a certificate for every user in the policy's Allthenticate group, so this must cover every synced user. |

When the subject is built from Active Directory, a CA with the KB5014754 update (May 2022 or later) also adds the SID extension `1.3.6.1.4.1.311.25.2`. Domain controllers now enforce it: a certificate without it is issued but can't sign in. The admin portal flags a policy whose certificates lack it with **Domain controllers may refuse these certificates**.

> [!NOTE]
>
> Keep the Certificate Generation Policy's **Key Type** at its default, **EC P-521**, which matches this template. The portal also offers **RSA 2048**, but Windows can't cache a domain sign-in made with an RSA key, so users can't sign in offline. If you need RSA, contact [help@allthenticate.com](mailto:help@allthenticate.com) before you set it up.

### Publish the template

In **Certification Authority**, right-click **Certificate Templates** and select **New** > **Certificate Template to Issue**, then select your template. Also check that the CA's **Properties** > **Policy Module** > **Properties** follows the template rather than pending every request.

| Check | How to verify | Expected result |
| - | - | - |
| Template published | **Certification Authority** > **Certificate Templates** | Your template is listed. |
| Template name recorded | Template **Properties** > **General** | You've written down **Template name**. |
| Cryptography | Template **Properties** > **Cryptography** | **Key Storage Provider**, **ECDH\_P521**, **521**, **SHA256**. |
| Subject name | Template **Properties** > **Subject Name** | **Build from this Active Directory information**, with UPN. |

## Issue the enrollment agent certificate

The bridge signs every user's request with an enrollment agent certificate. Its owner, the **Enrollment Agent certificate owner**, must be a normal user account that can sign in interactively; a group Managed Service Account (gMSA) can't. With CES, it's normally the same account as the CES authentication account. With WCCE, it doesn't need to be the bridge's run-as account.

**1. Allow the owner to enroll**

In the **Certificate Templates Console**, open the built-in **Enrollment Agent** template. On **Security**, add the owner with **Read** and **Enroll**. Then publish it: in **Certification Authority**, right-click **Certificate Templates** > **New** > **Certificate Template to Issue** > **Enrollment Agent**.

**2. Request the certificate**

On any domain-joined computer, sign in as the owner and open **Manage User Certificates**. Right-click **Personal** > **All Tasks** > **Request New Certificate**, and select **Enrollment Agent**. Under **Details** > **Properties** > **Private Key**, select **Make private key exportable**. Enroll, then select **Finish**.

**3. Export it as a PFX**

Right-click the certificate > **All Tasks** > **Export**. Select **Yes, export the private key** and keep **Personal Information Exchange - PKCS #12 (.PFX)**. Set a strong password, change the encryption from **TripleDES-SHA1** to **AES256-SHA256**, and leave **Group or user names** cleared, which the bridge doesn't support. Save it, for example as `enrollment-agent.pfx`, somewhere secure.

**4. Unpublish the Enrollment Agent template**

In **Certification Authority** > **Certificate Templates**, right-click **Enrollment Agent** and select **Delete**. This only stops the CA issuing from it; your exported certificate is unaffected.

> [!TIP]
>
> `certutil -v -dump -p "<password>" enrollment-agent.pfx` opens without a password error. Exactly one certificate shows `Provider = …` followed by `Signature test passed`, and its `Enhanced Key Usage` lists `Certificate Request Agent (1.3.6.1.4.1.311.20.2.1)`. The bridge refuses a PFX with no private key, more than one, or no certificate with this purpose.

> [accordion] Alternative on Windows: keep the enrollment agent key in the certificate store
>
> The Windows build of the bridge can take the enrollment agent certificate and key from the bridge host's Windows certificate store instead of a PFX, with `agent_cert_stores` (for example `LocalMachine\My`) in place of the PFX path and password. The key is used through CNG, so it can be non-exportable or held by the TPM, and the bridge searches the stores again before every batch, so a renewed certificate is picked up without a restart. `agent_cert_thumbprint` optionally pins one certificate; a renewal changes the thumbprint, so the pin must follow it.
>
> The account the bridge runs as needs **Read** on the private key: the gMSA, or the service identity `NT SERVICE\dc-bridge`. Without it, the bridge reports `cannot open the private key` and `does not give <account> Read`. See [Bridge configuration](https://help.allthenticate.com/windows/active-directory/configuration.md#enrollment-agent-certificate).

## Set up your enrollment path

> [tab] Web enrollment (CES)
>
> Install the Certificate Enrollment Web Service by following Microsoft's [CES guide](https://learn.microsoft.com/en-us/windows-server/identity/ad-cs/configure-certificate-enrollment-web-service), on the CA or a domain-joined IIS server, with one of the two authentication types the bridge supports:
>
> | CES authentication | Bridge `ces.auth.type` | Endpoint suffix |
> | - | - | - |
> | User name and password (WS-Security inside the request; not NTLM) | `UsernamePassword` | `_CES_UsernamePassword` |
> | Client certificate (mutual TLS) | `Certificate` | `_CES_Certificate` |
>
> Windows integrated (Kerberos) authentication to CES isn't supported. To have the CA authenticate the bridge's own Windows account, use WCCE.
>
> The account the installer creates to run the service is the **CES/IIS application-pool service account**. Never reuse it as any other account in this guide.
>
> Note the endpoint URL: `https://<host>/<CA-name>_CES_UsernamePassword/service.svc/CES` or `https://<host>/<CA-name>_CES_Certificate/service.svc/CES`. The bridge refuses a plain `http://` URL at startup, except to `localhost`, `127.0.0.1` or `[::1]` for local testing.
>
> The CES site's TLS certificate must be a Server Authentication certificate. If an internal CA issued it, export that CA's certificate as DER or Base-64 `.cer` (not `.p7b`), and make sure IIS sends the intermediate. To export it on the CA, run `certutil -ca.cert ca.cer`.
>
> **Client certificate authentication only:** sign in as the CES authentication account, request a certificate from the built-in **User** template (or any template with Client Authentication that builds the subject from Active Directory with the UPN), mark the key exportable, and export it like the enrollment agent PFX, for example as `ces-client.pfx`. The CES application-pool account must be trusted for constrained delegation to the CA's HOST and rpcss services with **Use any authentication protocol**, as in Microsoft's guide.
>
> | Check | How to verify | Expected result |
> | - | - | - |
> | URL and site certificate | On a domain-joined computer, open the URL up to `service.svc` in a browser | The page loads over HTTPS with no certificate warning; a sign-in prompt is fine. A 404 means the CA name or suffix is wrong. |
> | Reachable from the bridge host | `Test-NetConnection ca.internal.example.com -Port 443`, or `openssl s_client -connect ca.internal.example.com:443` on Linux | The port answers, and `openssl` names your CA as `issuer=`. |
> | Authentication type matches | Compare the URL suffix with the type you installed | They match. |

> [tab] Native enrollment (WCCE)
>
> With WCCE the bridge submits straight to the CA's built-in DCOM interface (MS-WCCE), so you install nothing on the CA. The CA authenticates the **bridge's run-as account**: the Windows account the bridge service runs as. Use a gMSA (recommended) or NetworkService, in which case the CA sees the bridge host's computer account, `DOMAIN\HOST$`. See [Install the bridge](https://help.allthenticate.com/windows/active-directory/bridge.md#run-as-account).
>
> **1. Grant Request Certificates on the CA**
>
> In **Certification Authority**, right-click the CA > **Properties** > **Security**. Add the run-as account (or `DOMAIN\HOST$`) and allow **Request Certificates**.
>
> **2. Grant Read and Enroll on the template**
>
> On your smart card logon template's **Security** tab, add the run-as account with **Read** and **Enroll**, next to the users' group, which keeps its own **Enroll**. Over WCCE the CA checks **Enroll** against the account that submits the request, not the user; the enrollment agent certificate is what lets the bridge act for the user.
>
> **3. Check DCOM access**
>
> The CA admits DCOM callers through its **Certificate Service DCOM Access** group, which contains Authenticated Users by default. If it was tightened, add the account. On the CA, `net localgroup "Certificate Service DCOM Access"` lists the members.
>
> **4. Restart Certificate Services**
>
> Run `Restart-Service certsvc` in an elevated PowerShell on the CA. Until then, the CA can keep using the old template permissions. If the bridge is already running, also give it a fresh logon (see below).
>
> **5. Open the network**
>
> Allow TCP 135 and the CA's dynamic RPC ports (49152-65535 by default) from the bridge host to the CA directly, plus Kerberos (TCP/UDP 88) to a domain controller. `HTTPS_PROXY` doesn't apply to DCOM.
>
> The run-as account needs a logon that carries network credentials: the bridge service as a gMSA, NetworkService or LocalSystem, or a scheduled task that stores its password. A task set to **Do not store password**, LocalService, or an SSH session signed in with a key carries none, and every request to the CA fails with `0x800706ba` (RPC server unavailable) even though TCP 135 answers.
>
> **After changing any of these rights**, restart Certificate Services, then give the bridge a fresh logon:
>
> * Service or stored-password task running as a domain account or gMSA: restart the bridge.
> * Bridge started from a console, or a task that runs only when the user is logged on: sign that user out and back in.
> * LocalSystem or NetworkService: restarting the service isn't enough. Restart the host, or as an administrator run `klist -li 0x3e7 purge` (SYSTEM) or `klist -li 0x3e4 purge` (NetworkService).
>
> | Check | How to verify | Expected result |
> | - | - | - |
> | CA config string | On the bridge host, run `certutil` with no arguments | Each enterprise CA prints `Config:` and a string in quotes, such as `"ca01.example.com\Example Issuing CA"`. Note it without the quotes for `wcce.ca_config`. |
> | CA answers over DCOM | `certutil -config "HOST\CA name" -ping` on the bridge host | `ICertRequest2 interface is alive` and `-ping command completed successfully`. It runs as whoever runs it and never tests **Enroll**. `0x800706ba` means ports, the host name, or a logon without network credentials; `0x80070005` points at DCOM access. |
> | Right on the CA | CA **Properties** > **Security** | The account has **Request Certificates**. |
> | Right on the template | Template **Properties** > **Security** | The account has **Read** and **Enroll**. |
> | DCOM access | `net localgroup "Certificate Service DCOM Access"` on the CA | Authenticated Users, the account, or a group it belongs to. |
> | Automatic issuance | Template **Issuance Requirements**; CA **Policy Module** | Manager approval cleared; the policy module follows the template. |
> | Changes applied | After the last rights change | `Restart-Service certsvc` has run since. |
>
> To test the ping as a domain service account rather than yourself, open a Command Prompt (not PowerShell) and run `runas /user:CORP\svc-allth-bridge "cmd /k certutil -config \"HOST\CA name\" -ping"`. That needs the account to be allowed to log on locally (otherwise error 1385). For a gMSA, skip it and rely on the bridge's own checks.

## Restrict what the bridge can issue

The enrollment agent certificate, together with the run-as account's CA rights, lets the bridge obtain logon certificates for any user the template and the CA allow. Treat the bridge host as Tier 0, like the CA itself, and cap it with an enrollment agent restriction. The CA enforces the restriction against the caller, so it limits what a compromised bridge host can issue. The CA's **Issued Certificates** view records the user as **Requester Name** and the run-as account as **Caller Name**.

**1. Restrict enrollment agents**

In **Certification Authority**, open the CA's **Properties** > **Enrollment Agents** and select **Restrict enrollment agents**.

**2. Add the bridge and its template**

Under **Enrollment agents**, add the bridge's run-as account (the gMSA, or the bridge host's computer account under NetworkService or LocalSystem). Under **Certificate Templates**, add your smart card logon template.

**3. Allow and deny groups**

Under **Permissions**, allow the groups the bridge may enroll for, and deny **Domain Admins**, **Enterprise Admins**, **Administrators**, **Account Operators** and any other Tier 0 group.

**4. Audit issuance**

On **Auditing**, select **Issue and manage certificate requests**, and turn on the audit policy: `auditpol /set /subcategory:"Certification Services" /success:enable /failure:enable`.

A request for a user in a denied group is refused with `0x80094009` and shows as an error on that one request in the admin portal, naming the run-as account; the policy's other users keep enrolling.

## What you should have now

* The enrollment agent PFX and its password (or the certificate in the bridge host's store).
* The **Template name** of your smart card logon template.
* **CES:** the `https://` endpoint URL, the CES credentials (user name and password, or the client PFX and its password), and the CA certificate that issued the CES site certificate.
* **WCCE:** the CA config string, a run-as account with the rights above, and a domain-joined Windows host for the bridge.

Next: [Install the bridge](https://help.allthenticate.com/windows/active-directory/bridge.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.