> For the complete documentation index, see [llms.txt](https://documentation.2pintsoftware.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.2pintsoftware.com/ipxe-ws/4.0/configuration/authentication.md).

# Authentication

When 2PXE Server is integrated with the iPXE Anywhere Web Service, the web service can require devices to be approved before they boot. Approval is controlled by PowerShell scripts in the iPXE Web Service **Scripts** folder, and by settings in the **Configure iPXE WS** configuration editor. For how to get updated scripts, see Updating the Scripts Folder.

Authentication requires the **BootRequest** feature to be enabled in 2PXE Server. See [Integrating with 2PXE Server](/ipxe-ws/4.0/configuration/integrating-with-2pxe-server.md).

## PowerShell scripts

### Configure the PIN

The **Device authentication script** setting (by default `Scripts\Authentication\DeviceAuthentication.ps1`) decides whether a device is approved. The default script approves a device when the correct PIN is entered, which is `42`. Change the `$secretPin` value in the script to use a different PIN.

Until the device is approved, the script shows the **iPXE Anywhere authentication menu** on the device, with these options:

| Option                           | Key | Description                                                                                                                                  |
| -------------------------------- | --- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| **Use a pin**                    | P   | Prompts for the PIN, and sends it to the web service.                                                                                        |
| **Retry request**                | R   | Sends the boot request again, for example after the device has been approved another way. This is the default, selected after 30 seconds.    |
| **Run the config tool**          | C   | Runs the iPXE configuration tool.                                                                                                            |
| **Drop to the iPXE shell**       |     | Opens the iPXE shell. Type `exit` to return to the menu.                                                                                     |
| **Reboot the computer**          |     | Restarts the device.                                                                                                                         |
| **Exit and continue boot order** | X   | Exits iPXE, so that the device continues with the next boot device. This only works when the device is set to try PXE before the local disk. |

The QR code and user name and password options that were shown in earlier versions of the menu have been removed, because they were not implemented.

### Other examples

The script can also approve a device without prompting, for example based on its network, by setting `$RequestStatusInfo.Approved` to `$true` and returning `$RequestStatusInfo`. More examples may be available in the [2Pint GitHub repository](https://github.com/2pintsoftware/2Pint-iPXEAnywhere/tree/main).

## Authentication settings

The following settings are in the **General settings** section of the configuration editor. Turn on **Show advanced** to see them. See the settings reference for details.

| Setting                                                            | Default           | Description                                                                                          |
| ------------------------------------------------------------------ | ----------------- | ---------------------------------------------------------------------------------------------------- |
| **Auto-approve devices** (`AutoApproveDevices`)                    | Off               | Approves every device without running the device authentication script.                              |
| **Approved devices request limit** (`ApprovedDevicesRequestLimit`) | `604800` (7 days) | How long, in seconds, an approval remains valid. The device authentication script can override this. |

### Turn off authentication

To let devices boot without authentication, turn on **Auto-approve devices**, save the configuration, and restart the service when prompted.

### Change how long an approval lasts

To change how long a device can boot before it must be approved again, change **Approved devices request limit** to a value that matches your policies. Do not set it too low: if the approval expires before the iPXE boot process is complete (after a few seconds, or even a few minutes), the device fails to boot.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://documentation.2pintsoftware.com/ipxe-ws/4.0/configuration/authentication.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
