Authentication Server with Nostr
  • Go 73.6%
  • JavaScript 21.8%
  • CSS 1.8%
  • Python 1.2%
  • HTML 0.8%
  • Other 0.8%
Find a file
2026-03-20 20:00:03 +04:00
.github/workflows chore(deps): update github artifact actions (#13) 2026-03-16 00:31:14 +04:00
art chore: .gitignore update + credits and art 2026-03-10 23:47:37 +04:00
cmd refactor: improve controller and authorization readability 2026-03-16 10:55:44 +04:00
examples/proxy feat: forward group headers to upstream apps 2026-03-12 23:06:30 +04:00
internal feat: allow wildcards 2026-03-20 20:00:03 +04:00
kubernetes feat: allow wildcards 2026-03-20 20:00:03 +04:00
public feat: initial commit 2026-03-10 23:30:33 +04:00
resources fix: make redirection be done in the backend 2026-03-18 15:46:01 +04:00
scripts feat: automate webp assets and rollout readiness 2026-03-13 01:47:14 +04:00
.air.toml feat: initial commit 2026-03-10 23:30:33 +04:00
.dockerignore feat: add kubernetes deployment manifests 2026-03-13 00:12:27 +04:00
.env.example chore: add temporary debug feature 2026-03-16 12:31:32 +04:00
.gitignore chore: update local development defaults 2026-03-13 00:14:16 +04:00
.go-version feat: initial commit 2026-03-10 23:30:33 +04:00
.golangci.yml feat: initial commit 2026-03-10 23:30:33 +04:00
.goreleaser.yml ci: add go releaser 2026-03-13 11:15:04 +04:00
assets.go feat: automate webp assets and rollout readiness 2026-03-13 01:47:14 +04:00
bun.lock chore(deps): update dependency @vitejs/plugin-react to v6 (#15) 2026-03-16 00:32:18 +04:00
config.json.example feat: allow wildcards 2026-03-20 20:00:03 +04:00
Dockerfile chore(deps): update docker/dockerfile docker tag to v1.22 (#14) 2026-03-16 00:32:00 +04:00
go.mod refactor: remove nip05 support 2026-03-16 10:56:37 +04:00
go.sum refactor: remove nip05 support 2026-03-16 10:56:37 +04:00
go.work feat: initial commit 2026-03-10 23:30:33 +04:00
go.work.sum refactor: remove nip05 support 2026-03-16 10:56:37 +04:00
LICENSE feat: initial commit 2026-03-10 23:30:33 +04:00
package.json chore(deps): update dependency @vitejs/plugin-react to v6 (#15) 2026-03-16 00:32:18 +04:00
Procfile.demo feat: initial commit 2026-03-10 23:30:33 +04:00
Procfile.dev chore: update local development defaults 2026-03-13 00:14:16 +04:00
Procfile.dev.ssr feat: initial commit 2026-03-10 23:30:33 +04:00
README.md feat: allow wildcards 2026-03-20 20:00:03 +04:00
renovate.json chore: add renovate.json (#1) 2026-03-16 00:19:20 +04:00
Taskfile.yml feat: automate webp assets and rollout readiness 2026-03-13 01:47:14 +04:00
vite.config.js feat: add client-side login and logout flow 2026-03-12 23:03:52 +04:00

Nostr Auth

Demo GIF

Nostr Auth lets you keep your identity while providing a simple way to manage access to your platforms. It makes your identity portable across web applications, so you can use Nostr-based authentication with existing services — without introducing unnecessary complexity.

Why Nostr Auth?

Existing authentication solutions are powerful and widely adopted in the web2 world, but they are not always a natural fit for Nostr-based users. Nostr Auth sits in front of your existing web applications and adds a Nostr-based authentication layer, so you can protect resources while preserving your users' portable identity.

Use Cases

  • Adding Nostr authentication to existing web applications
  • Protecting internal or private resources
  • Enabling identity-based access control for Nostr users
  • Protecting multiple configured upstream domains behind a single auth app

Note

This version uses cookie-based authentication for the auth app itself, but it can still protect multiple configured upstream domains through the forward-auth flow. Redirect targets are restricted to domains configured under auth.apps.

Requirements

  • Taskfile
  • Go 1.26+
  • Overmind (go install github.com/air-verse/air@latest)
  • Air (go install github.com/air-verse/air@latest)
  • Golangci-lint (go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest)
  • bun
  • Docker and Docker Compose (to try demo)

Running Locally

  • Fork
  • bun install
  • go install
  • cp config.json.example config.json
  • Edit the config.json
  • cp .env.example .env
  • Edit the .env
  • task dev

Should be available on http://localhost:3000

Config

config.json controls both access rules and branding.

{
  "auth": {
    "enabled": true,
    "groups": {
      "admins": [
        "npub1..."
      ]
    },
    "apps": {
      "default": {
        "config": {
          "domains": [
            "app.example.com"
          ]
        },
        "users": [
          "group:admins"
        ]
      },
      "public": {
        "config": {
          "domains": [
            "demo.example.com"
          ]
        },
        "users": [
          "*"
        ]
      }
    }
  },
  "branding": {
    "background": {
      "source": {
        "type": "preset",
        "variant": "canyon-falls"
      }
    }
  }
}
  • auth.enabled turns authorization on or off
  • auth.groups defines reusable user groups with npub, hex public keys, or nested group:<name> references
  • auth.apps defines which domains are protected and which users or groups can access them
  • auth.apps.*.users accepts * to allow any authenticated Nostr user for that app's configured domain
  • auth.apps.*.config.domain or auth.apps.*.config.domains also define the allowed post-login redirect targets
  • branding.background.source.type currently supports preset
  • branding.background.source.variant can be canyon-falls (default), fields-road, mountain-valley, or storm-valley
  • if branding is omitted, the app falls back to canyon-falls

Important

Authorization is pubkey-based. NIP-05 values are not supported in authorization rules and are ignored with a warning because they are not a safe basis for access control.

Testing Demo

  • bun install
  • go install
  • task demo — check out the examples README.md

Supports

  • Kubernetes Gateway API
  • Kubernetes Ingress
  • Nginx
  • Traefik
  • Envoy
  • Caddy

License

MIT

Credits