# NFC / RFID card

> Set up RFID card authentication in Ironchip: install the agent, generate the API key, create accesses, register cards and link the reader.

URL: https://docs.ironchip.com/en/identidad/usuarios/rfid/

RFID authentication lets you use an access card as an authentication method with a reader connected to the computer. This guide explains how to prepare the console, install the agent and link the reader.

## Requirements

- Administrator access to the Ironchip admin console.
- Administrator permissions on the system.
- Compatible readers and cards.

## Install the agent

1. Go to the Ironchip admin console and sign in with your credentials.
2. In the left side menu, select the **Plugins** section.

   [Image: Console side menu with the Plugins section]

3. Find the **RFID Authenticator** package and download it. Save the file in an accessible location, because you will need it in later steps.

   [Image: RFID Authenticator package in the Plugins section]

## Generate the API key

The agent needs an API key to work. To generate it:

1. In the admin console, go to **Authentication Policies > Device Policies**.

   [Image: Authentication Policies menu with the Device Policies option]

2. Click **Add device policy** to create a new entry.

   [Image: Add device policy button in the device policies list]

3. Give the policy a descriptive name.
4. Turn on the **Use RFID protocol** option.
5. Click **Add** to confirm. The system automatically generates an API key.

   [Image: Policy form with the Use RFID protocol option turned on]

## Create the access

To create an RFID access, you must first have created a sign-in application. Once you have it:

1. Click **Add access** to add a new access.

   [Image: Add access button of the sign-in application]

2. Select the **authenticator user**, that is, the person who is going to authenticate.

   [Image: Selecting the authenticator user]

3. Enter the **user to protect** in the right format for the account type:

   - Domain user: `DOMAIN\user`
   - Local user: `COMPUTER_NAME\user`

4. Click **Next**.

   [Image: Field for the user to protect and the Next button]

5. In the authentication method field, select the RFID policy you created earlier.

   [Image: Selecting the RFID policy as the authentication method]

6. Click **Add** to finish. The access is created and active.

   [Image: Generated and active RFID access]

## Create RFID cards in Ironchip

To register RFID cards on the platform, go to **Directory > Devices > RFID** and follow these steps:

[Image: Directory > Devices > RFID section of the console]

1. Click **Synchronize** to open the import process.

   [Image: Synchronize button in the RFID section]

2. Download the template that the system provides.

   [Image: Button to download the import template]

3. Fill in the template with this data for each card:

   | Field    | Description                                             |
   | -------- | ------------------------------------------------------- |
   | `UserID` | The user's ID in Ironchip, available on the user's page |
   | `Email`  | The user's email address                                |
   | `Name`   | A name that identifies the card                         |
   | `UUID`   | The unique identifier of the RFID card                  |

   [Image: Import template filled in with the card data]

4. Upload the completed template to Ironchip and click **Next**.

   [Image: Screen to upload the completed template]

5. On the next screen, select the RFID policy you created earlier.

   [Image: Selecting the RFID policy for the cards]

6. Confirm the operation by clicking **Add**. The cards are registered in the system.

   [Image: RFID cards registered in the system]

## Configure the agent

With the agent downloaded and the API key available, open a PowerShell window as administrator and go to the directory where the agent file is.

1. Link the API key to the agent. Replace `<API_KEY>` with the key you generated earlier:

   ```powershell
   .\IronchipRFID.exe c --api_key <API_KEY>
   ```

   [Image: Command that applies the API key to the agent in PowerShell]

2. Check that the configuration was applied. This command shows the active parameters of the agent:

   ```powershell
   .\IronchipRFID.exe c show
   ```

   [Image: Active agent parameters shown in PowerShell]

3. Install the agent as a system service:

   ```powershell
   .\IronchipRFID.exe s install
   ```

   [Image: Command that installs the agent service]

4. Start the agent service so it begins to work:

   ```powershell
   .\IronchipRFID.exe s start
   ```

   [Image: Command that starts the agent service]

### Uninstall the agent

To uninstall the agent, you must stop it first. Follow these two steps in order:

1. Stop the service:

   ```powershell
   .\IronchipRFID.exe s stop
   ```

   [Image: Command that stops the agent service]

2. Once it is stopped, uninstall the agent from the system:

   ```powershell
   .\IronchipRFID.exe s uninstall
   ```

   [Image: Command that uninstalls the agent service]

## Configure the reader in the agent

When the agent service is installed and running, the last step is to link the RFID reader so the system can capture card reads.

### HID reader

If your reader identifies itself as a human interface device (HID), use this command to open the interactive selection menu:

```powershell
.\IronchipRFID.exe hid
```

A list of the HID devices the system detects is shown. Enter the number of the reader you want to use to complete the link.

[Image: List of HID devices detected by the agent]

### Serial reader

If the reader connects through a serial port or a COM port emulator, use the command for serial devices. With it you define the COM port and the communication parameters the agent needs to talk to the hardware:

```powershell
.\IronchipRFID.exe srl
```
