---
title: Sign in with Lightning (LNURL-auth)
description: Headless and interactive LNURL-auth sign-in for bitSimp API clients.
last_updated: 2026-09-04
meta:
  contentType: how-to
---

# Sign in with Lightning (LNURL-auth)

1. Request a challenge:

```bash
curl -s https://bitsimp.com/api/auth/lightning/lnurl-auth/challenge
```

2. Preferred headless path: strip `lightning:` from `lnurl`.

3. Run the plugin/skill ([dyegolara/lnurl-auth-agents](https://github.com/dyegolara/lnurl-auth-agents)) with `--dry-run --json`.

4. Extract `sig` + `key` from `callbackUrl`.

5. Fallback: sign `challenge` directly with secp256k1 ECDSA DER.

6. Exchange proof for a session cookie:

```bash
curl -s -c cookies.txt -X POST https://bitsimp.com/api/auth/lightning/lnurl-auth/login \
  -H 'content-type: application/json' \
  -d '{"pubkey":"<key>","challenge":"<challenge>","sig":"<sig>"}'
```

Use `cookies.txt` on authenticated calls.
