---
title: Protect the admin interface
project: OpenAuth
version: 1.0
section: guides
language: en
license: MIT
url: https://totaljs.es/docs/openauth/1-0/guides/protect-admin/
updated: 2026-11-19T09:22:03.169Z
---

# Protect the admin interface

> Set the primary access token on the first start and open the admin interface with it.

A new OpenAuth has no password. Until you save a **Primary access token**, anyone who can reach the server can open the admin interface. Set the token as the first thing you do.

## Set the primary access token

**1.** Open `http://localhost:8000/` (or your server address). OpenAuth opens the admin interface.

![The main screen of OpenAuth with Extensions, Tokens and Configuration](/files/JapjQ62Ml61f.webp)

**2.** Open **Configuration** (the cog in the left menu).

**3.** Under **Security**, click **Generate** next to **Primary access token**, or type a long token of your own.

![The Configuration panel with the Name field and the masked Primary access token](/files/JapjQ72Nl60f.webp)

**4.** Press **SUBMIT**. OpenAuth says that the configuration has been saved and that the app needs to be reloaded. Press **OK**, and the admin interface opens again with the new token.

**5.** The address bar now ends with `/setup/?token=...`. Copy the token from there and keep it in your password manager.

## Open the admin interface later

Add the primary access token to the address of the admin interface:

```text
https://auth.example.com/setup/?token=YOUR_PRIMARY_TOKEN
```

Without the right token, OpenAuth answers `401 Unauthorized`. The root address `/` shows only the name of the app, so you can use it to check that OpenAuth is running.

## Change the token

Open **Configuration**, click **Generate** (or type a new token) and press **SUBMIT**. The old token stops working at once.

The primary access token is only for the admin interface. Your apps use their own [app tokens](../app-tokens/).

If you lose the token, see [Admin access](../../faq/admin-access/).
