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

# Auth: who can sign in to your app

> Managed identity gives a forge app sign-in for its own users with no auth server to run. How to turn it on, what the Auth page's Users and Sign-in tabs show, and what it doesn't do yet.

This page is about the people who use the app you deploy: the customers or teammates who open your site and sign in. It is not about signing the `reliant` or `forge` command line in to Reliant, which is [Forge sign-in](https://docs.reliantlabs.io/forge/sign-in.md).

A forge app that needs accounts doesn't need you to run an identity provider. You declare its users once in KCL, and on [Reliant hosting](https://docs.reliantlabs.io/hosting/overview.md) the platform runs a sign-in service for each environment, hands your API its issuer and client id, and gives you a page to see and manage the people in it. That declaration is **managed identity**.

## Turn it on

A project with a frontend declares its users in one file, `deploy/kcl/identity.k`, and each environment imports it. Only where it runs differs:

```python theme={null}
# deploy/kcl/identity.k, imported by every env
IDENTITY = forge.ManagedIdentity {
    roles = [
        forge.IdentityRole {key = "admin", display_name = "Administrators"}
        forge.IdentityRole {key = "member"}
    ]
}

# deploy/kcl/prod/main.k: runs on the control plane (hosted)
identity = idn.IDENTITY

# deploy/kcl/dev/main.k: the same declaration on a sign-in server on your machine
identity = idn.IDENTITY | {runtime = forge.IdentityOnHost {infra = "idp"}}
```

In `dev`, `reliant forge env up dev` starts a local identity provider (Zitadel, as a host process, with no container) and converges your declaration into it, so you can sign in to your own app while you build it. In `staging` and `prod` the default runtime is the control plane's, which needs the environment to declare a `control_plane`; an identity declared without one fails `reliant forge env render`. The next `reliant forge env deploy` publishes the declaration, the platform creates the sign-in service shortly after, and the deploy waits on it: a release whose rollout succeeded reports "waiting on identity" until the identity is ready.

From that one declaration forge fills your API's `jwt_issuer`, `jwt_audience`, `oidc_client_id`, `oidc_redirect_uri` and related fields. You write no `config.k` line for them and copy no client id. The reverse also holds: a workload that sets `JWT_ISSUER`, `JWT_AUDIENCE`, `OIDC_CLIENT_ID`, `OIDC_REDIRECT_URI` or `IDP_BASE` by hand next to a declared identity fails `reliant forge env render`, naming both, so there is one source for each value.

Beyond roles, the declaration can name machine users, `owners` who must be able to get in, who may create an account (`signup`: `invite` by default, `open` or `domain`), the sign-in `methods` (`password`, `passkey`, `magic_link`), social providers, your own SMTP server, and `share_with` so a preview environment reuses its project's staging users. `reliant forge skill load deploy/managed-identity` has every field and what is refused.

## How people sign in

Sign-in is native to your app. The browser sends an email and password to **your own API** (`POST /auth/login`) and receives an HttpOnly session cookie. Your server runs the whole OpenID Connect exchange with the issuer, so there is no token in JavaScript and the browser never contacts the identity provider. The scaffolded frontend ships the sign-in, forgot-password and reset-password screens.

Every RPC then requires a signed-in caller unless its proto sets `auth_required: false`. That tells you who the caller is. It never decides what they may do: forge ships no authorization, so which rows a user may see is code you write, starting from `middleware.GetUser(ctx)`.

## The Auth page

In the project shell, **Auth** sits beside Data and Storage in the sidebar. It follows the environment control in the top bar and has two tabs, **Users** and **Sign-in**, each a link you can share. An old link to the project's **Users** page opens the Users tab, and the same panels are also on an environment's **Identity** tab.

### Users

The Users tab lists everyone who can sign in to the environment, which includes people you invited who haven't signed in yet, not only people who have. Search by part of an email address (up to 200 characters) and filter by state. Each row shows:

| Column | Meaning |
| - | - |
| User | Email and name |
| State | **Active**, **Invited** (no credential yet), **Locked** (blocked from signing in) or **Disabled** |
| Roles | The roles they hold. A role with a lock icon is declared in KCL and can't be edited here. |
| Added | When the account was created |
| Last sign-in | When they last signed in successfully. **Never** if they haven't. A dash means this deployment doesn't report it. |

A row's menu and **Invite** panel carry the actions: invite someone with roles, edit roles, send a password reset, get a one-time reset link, lock or unlock, end sessions, and delete (last, and apart from the rest). Lock, end sessions and delete ask you to confirm. **App data** opens that person's rows in [Data](https://docs.reliantlabs.io/forge/data.md), when one of your columns is marked with `COMMENT ON COLUMN users.external_id IS 'forge:identity-subject'`. Mark it only when this identity issued those values.

Who can do what. Any member of the organization can read the list. Every action that changes a person needs an organization admin, and a member doesn't see controls they would be refused. Every action is audited.

Two behaviors surprise people:

* **Roles come in two kinds.** A role declared with `members_from = "declared"` is converged from `identity.k` on every deploy, so editing it in the console would be undone and is refused. Every other role is console-managed. Saving roles replaces the person's whole console-managed set.
* **Email isn't assumed.** The sign-in service sends mail only if the environment declares `smtp` (or the platform's own delivery is on for it; the Sign-in tab says which). With no mail, invite and reset can't email anyone, so the page hands you a **one-time link** to deliver yourself. The link is a credential: send it only to the person it's for, and never post it in a shared log. Single use, and it expires within the hour.

Sorting by Added or Last sign-in reorders only the people already loaded; the server lists oldest first and takes no sort, and the footer says when more remain.

A deployed app is **invite-only** by default. Public sign-up (`POST /auth/register`) is served in development, and in a deployed environment only if its config sets `auth_self_signup: true`, or the declaration sets `signup` to `open` or `domain`. Before opening it, remember that a self-registered address is unverified: anything you bind to a user by email must check `devidp.User.EmailVerified` first.

### Sign-in

The Sign-in tab is the sign-in service itself, as of the platform's last reconciliation pass:

| Field | Meaning |
| - | - |
| State | **Ready** is healthy. **Pending**, **Creating** and **Provisioning** are on the way. **Degraded** still serves. **Failing** is an error, shown with the failed attempts, the last error and the next retry. **Withdrawn**, **In grace period**, **Deleting** and **Deleted** follow when an environment stops declaring an identity. |
| Issuer | `https://<slug>.reliantidentity.com`. The slug is assigned once when the instance is created and never recomputed, so renaming an environment or project can't move your issuer. |
| Reachable | **Private** (only from your clusters, the default) or **Public** (anyone can reach the sign-in pages) |
| Email | How the instance sends mail: your own SMTP server, the platform's delivery, or none |
| Owner and sharers | If this environment shares another's users, which environment owns them |
| Applications | One row per application: name, client id and **broker token** (when it renews, or `expired`) |
| Deliveries | Where the issuer and credentials were written for your workloads, with each delivery's state, when it was written and when it was verified |
| Export | **Export users** (admins) writes every user, password hashes included, in Zitadel's import format and gives you a download link that works for a few minutes for whoever holds it. Asking again within 15 minutes returns the same export. |

A side panel, **Configure sign-in**, says what the page can't do: sign-in is declared in the repo (`deploy/kcl/identity.k`), so changing it is a reviewed change and a deploy, not a setting here.

If the environment declares no identity, the tab says so and shows the line to add. A **local** environment says it signs in against your local provider and shows no status, because that provider reports nothing to Reliant; its issuer and seed users are printed by `reliant forge env up`. Other states you may meet: the control plane doesn't run identity management yet; the declaration was refused (the page shows the server's reason, and the fix is to correct the declaration and deploy again); the environment hasn't recorded a deployed shape yet (deploy it); or you aren't a member of the organization that owns it.

### From the terminal

`reliant forge cloud identity` does the same work: `status`, `users`, `invite`, `set-roles`, `reset`, `lock`, `unlock`, `revoke-sessions`, `delete` and `export`. Reading needs the `identity:read` scope and changing anything needs `identity:manage`, held by org admins; under Reliant forge exchanges your sign-in for the scope it needs. See the [CLI reference](https://docs.reliantlabs.io/reference/cli.md#reliant-forge-cloud-identity).

## Your own provider

Managed identity is the default, not a requirement. For Auth0, Okta, Keycloak, Supabase, Clerk or a Zitadel you run, declare no `identity` for that environment and set `jwt_issuer` and `oidc_client_id` in its `config.k`. The Users and Sign-in tabs then have nothing to show for it, because Reliant isn't running the service. `reliant forge skill load auth/external-provider` covers it.

## Limits

* **Hosted login isn't built.** `login.mode = "hosted"` is accepted and recorded, but nothing provides it. Sign-in is your app's own form.
* **Some features depend on the platform's switches, which were off in the control plane's production configuration when this was written:** the user export (the panel says "Export isn't enabled for this deployment yet", and `forge cloud identity export` is refused), social sign-in with Google and GitHub (the declaration is accepted but not yet admitted), and the platform's mail relay. Until then, declare your own `smtp` if you need the service to send email. A withdrawn instance also waits rather than being deleted unexported. Check the Sign-in tab, which reports what is on for your environment.
* **No invite or admin screen is scaffolded for your own app.** The console's Users tab is for you, the builder. To let your end users invite each other, you build that screen and call the control plane's API or the broker yourself.
* **Forge authenticates, never authorizes.** Nothing in the framework flags a missing permission check on a row.
* **Passwords are never shown.** There is no password option, seeded production user or implicit recipient. A password reset issues a code, and the person's current password keeps working until it is redeemed.
* **Ending sessions doesn't revoke tokens already issued.** They stay valid until they expire.
* **Declared roles can't be edited in the console, and a user who holds one can't be deleted from it.** Change them in `identity.k`.
* **Privacy:** the people on this page are your app's visitors, not users of Reliant. See [Visitors to apps you host with us](https://docs.reliantlabs.io/help/privacy.md#visitors-to-apps-you-host-with-us).

## Related topics

* [Forge sign-in](https://docs.reliantlabs.io/forge/sign-in.md): signing the `forge` and `reliant` commands in to Reliant, which is separate from this page
* [What gets deployed](https://docs.reliantlabs.io/forge/deploy/what-gets-deployed.md#on-reliant-hosting): where identity sits among the other hosted resources
* [Hosting on Reliant](https://docs.reliantlabs.io/hosting/overview.md) and [Environments](https://docs.reliantlabs.io/forge/deploy/environments.md)
* [Data](https://docs.reliantlabs.io/forge/data.md): the app's own rows, linked to the person who owns them
* [Product analytics](https://docs.reliantlabs.io/forge/observability/product-analytics.md): sign-ups and active users counted from sign-in events
* [Secrets](https://docs.reliantlabs.io/hosting/secrets.md): where an SMTP password or social client secret is stored


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