Skip to content
Back to skills

Sign In Opt Out

ASecurity

Projects without a browser sign-in are born without forge's (forge v1.15.0). A project with no frontend, or created with --auth-mode none or --disable sign_in, no longer declares the oidc_*/idp_* config fields, so it gets no internal/app/login_broker.go, no Sessions provider, no auth_sessions migration and no idp-steps.yaml; `features: {sign_in: false}` pins that for any project. An older project that signs nobody in through a browser still carries all of it, and nothing changes by itself. Re...

  • 12 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 1, 2026
ai-agentsrustgobashsqlnodedockergitapifrontend

Works with

  • cli
  • api

Security analysis

A100/100

Scanned December 1, 2026

npx -y skills add reliant-labs/forge --skill sign-in-opt-out --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Sign In Opt Out?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Sign In Opt Out
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/reliant-labs-sign-in-opt-out/badge)](https://www.skillsdirectory.com/skills/reliant-labs-sign-in-opt-out)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: migrations/v1.15.0/sign-in-opt-out
description: Projects without a browser sign-in are born without forge's (forge v1.15.0). A project with no frontend, or created with --auth-mode none or --disable sign_in, no longer declares the oidc_*/idp_* config fields, so it gets no internal/app/login_broker.go, no Sessions provider, no auth_sessions migration and no idp-steps.yaml; `features: {sign_in: false}` pins that for any project. An older project that signs nobody in through a browser still carries all of it, and nothing changes by itself. Removing it is a hand edit, because the files are yours — pin the feature, delete login_broker.go and idp-steps.yaml, trim providers.go, drop the tables with a forward migration, remove and reserve the config fields. Use when a project with no frontend (an API called with bearer tokens or API keys) or with `--auth-mode none` still has internal/app/login_broker.go or the idp_* config fields, or when `forge generate` warns that features.sign_in is off while login_broker.go exists.
version: v1.15.0
detection: forge-detect unused-sign-in
---

# Removing forge's browser sign-in from a project that does not use it (v1.15.0)

Before v1.15.0 every service project's config proto declared the fields of
forge's browser sign-in — `oidc_client_id`, `oidc_redirect_uri`,
`oidc_scopes`, the `idp_*` fields, `trusted_proxy_hops`, `auth_self_signup`
and `handoff_redirects` — whether or not anyone could sign in. Those fields
are what `forge generate` keys the rest on, so every project got:

| Artifact | What it is |
|---|---|
| `internal/app/login_broker.go` | the server half of native sign-in (`/auth/*` routes), ~1,700 lines |
| the `Sessions` provider in `internal/app/providers.go` | server-side sessions (`forge/pkg/session`) and the `RegisterLoginBroker` mount |
| `db/migrations/<ts>_create_auth_sessions.up.sql` | the `auth_sessions` and `auth_handoffs` tables |
| `idp-steps.yaml` | the dev identity provider's declared state |

In a project with no frontend none of it runs: the broker mounts only once its
`idp_*` settings are set, and nothing sets them. From v1.15.0 such a project is
born without it, and `features.sign_in` names the choice:

- **Derived.** `sign_in` is on when `deploy/kcl/identity.k` exists or a config
  proto declares the broker's fields (`forge project features` says which).
  So an older project, which declares them, derives it ON and keeps working
  exactly as before.
- **Pinned.** `features: {sign_in: false}` in forge.yaml (what `forge project
  new --disable sign_in` writes) tells `forge generate` never to birth the
  broker, the `Sessions` provider, the sessions migration or `idp-steps.yaml`,
  whatever the tree says.

The API's own authentication is **not** this feature. `internal/app/auth.go`
(`SetupAuth`), the fail-closed interceptor, the `jwt_*` fields, API keys
(`auth/api-keys`) and `auth_required` stay as they are.

## Does this project use it?

It does if any of these is true; if so, stop here, and pin
`features: {sign_in: true}` so this playbook stops being offered:

- a frontend in this repo signs in through `/auth/login` (native sign-in);
- a frontend or app OUTSIDE this repo (a mobile app, another repo's site)
  calls this server's `/auth/*` routes;
- some env's `deploy/kcl/<env>/config.k` or secret store sets `IDP_BASE`,
  `IDP_LOGIN_URI` or `IDP_BROKER_TOKEN`.

`rg -n 'idp_base|idp_login_uri|IDP_BASE|IDP_LOGIN_URI|/auth/login' deploy frontends`
answers the last two for the repo.

## The steps

Run them in one change; the build is green again after step 4.

### 1. Pin the feature off

```yaml
# forge.yaml
features:
  sign_in: false
```

From here `forge generate` never re-creates what the next steps remove, even
in a fresh clone, and says so if `login_broker.go` is still on disk.

### 2. Delete the broker and the dev IdP's steps

```bash
git rm internal/app/login_broker.go idp-steps.yaml
```

Both are yours, and deleting them sticks: the birth ledger
(`.forge/scaffolded/`) records `login_broker.go`, and `forge project upgrade`
leaves a deleted `idp-steps.yaml` deleted. Delete any test you wrote against
the broker with it.

### 3. Trim `internal/app/providers.go`

`providers.go` is yours too, so forge does not edit it. Remove what reads the
broker or the sessions (the exact text depends on when it was scaffolded):

- the `Sessions` type, `SessionsDeps`, `NewSessions` and `(*Sessions).Run`;
- the `Sessions *Sessions` fields on the authenticator's and the API
  listener's deps structs, and the `authenticator.UseSessions(...)` block;
- the `Broker *config.<X>` deps field, if there is one;
- the block that calls `LoginBrokerConfigured(...)` and
  `RegisterLoginBroker(...)` (with `WithSessions(...)`);
- the `forge/pkg/session` import.

Then `forge generate`: `internal/app/graph_gen.go` is regenerated from the
`New*` constructors left in `providers.go`, so the `Sessions` node goes with
`NewSessions`. `go build ./...` must pass now.

### 4. Remove the config fields, and reserve them

Delete these fields from `AppConfig` in `proto/<project>/config/v1/config.proto`
(and their comment blocks): `oidc_client_id` (30), `oidc_redirect_uri` (31),
`oidc_scopes` (32), `idp_login_uri` (33), `idp_base` (34), `idp_host` (35),
`idp_broker_token` (36), `idp_broker_token_file` (41), `auth_self_signup` (48),
`idp_login_policy` (49), `trusted_proxy_hops` (50), `handoff_redirects` (51).
Keep every `jwt_*` and `cors_*` field: bearer tokens and CORS are not browser
sign-in. Reserve what you removed, as the `proto-breaking` skill requires:

```proto
  reserved 30 to 36, 41, 48 to 51;
  reserved "oidc_client_id", "oidc_redirect_uri", "oidc_scopes", "idp_login_uri",
    "idp_base", "idp_host", "idp_broker_token", "idp_broker_token_file",
    "auth_self_signup", "idp_login_policy", "trusted_proxy_hops", "handoff_redirects";
```

Before deleting, check nothing sets them: an owned `deploy/kcl/<env>/config.k`
that does fails the render once the field is gone, and a secret store entry
for `IDP_BROKER_TOKEN` is now unread (delete it). `forge generate` then
regenerates `config_gen.go` (in `pkg/config`, or `internal/config` since
v1.19.0) and `deploy/kcl/config_gen.k` without them.

### 5. Drop the tables with a forward migration

The `create_auth_sessions` migration is already applied, so never delete or
edit it: the applied schema and migration safety would disagree with the files.
Add a new one:

```bash
forge db migration new drop_auth_sessions \
  --backward-compatible "the previous release never configured the login broker, so it never read these tables"
```

```sql
-- <ts>_drop_auth_sessions.up.sql
-- forge:allow-destructive: forge's browser sign-in tables; nothing in this project signs anyone in through them
DROP TABLE IF EXISTS auth_handoffs;
DROP TABLE IF EXISTS auth_sessions;
```

Its `.down.sql` recreates them: copy the `CREATE TABLE` statements (and their
indexes) from the `create_auth_sessions` migration.

### 6. Verify

```bash
forge generate && forge lint && go build ./... && task test
forge project features   # [ ] sign_in  (pinned in forge.yaml features:)
```

`forge project upgrade list` stops offering this playbook once neither
`login_broker.go`, the broker's config fields nor `idp-steps.yaml` is left.

## What stays

- `middleware.go`'s session cookie names (in `pkg/middleware`, or
  `internal/middleware` since v1.19.0). They are constants
  the auth chain may read in development; leaving them costs nothing.
- `docker-compose.yml`'s `OIDC_*` passthrough variables on the `app` service.
  An env var no config field declares is ignored; delete the lines if you like.

## Adding sign-in later

Remove the reservations (a deliberate `buf breaking` exception, see
`proto-breaking`), declare the fields again (copy them from a scratch
`forge project new x --frontend web`), drop the `sign_in` pin, and run
`forge generate`: it births `login_broker.go`. The rest (the identity, and
the `Sessions` provider in `providers.go`) is in `auth/no-sign-in`, "Adding
sign-in later".

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.