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

# Sign-in troubleshooting

> What the token test's refusals and the client API's errors mean when people sign in to your app, and what to check for each.

The client API answers every refused token with the same 401 `invalid_key` and never says why. To find the reason, paste a fresh token into the token test. It gives the code below. See [Linking people](https://docs.getlurk.com/end-user-auth/linking-people.md#test-a-token).

## Token test refusals

| Code | What it means | What to check |
| - | - | - |
| `invalid_token` | The token is not valid: a bad signature, a shape Lurk does not read, a key ID Lurk does not have, a `sub` that is not 1 to 255 printable ASCII characters, a token not valid yet, a Clerk token that is not a version 2 session token, or, on a generic `oidc` issuer, an access token. | Paste the whole token, with three parts. Use the ID token, not an access token. Lurk refuses `typ: at+jwt`, a Cognito `token_use: "access"` and any Auth0 `gty` claim (a machine-to-machine token). For Clerk, use the session token, not a JWT template token. If the provider rotated its keys, run **Check keys** again. |
| `wrong_issuer` | `iss` is not the issuer you saved. | Compare `iss` with the issuer exactly. A trailing slash counts. Check you added the right provider project. |
| `wrong_audience` | `aud` is missing, holds several values or is not one you listed. | Supabase uses `authenticated` unless you changed it. For Clerk, list no audience unless your tokens carry exactly one. For other providers, list the audience your tokens carry. |
| `wrong_authorized_party` | Clerk only. `azp` is missing or is not one of your origins. | List the exact origin your app signs in on, with scheme and no path. A client that sends no `Origin` gets no `azp`. |
| `pending_session` | Clerk only. The session has steps left, such as joining an organization. | Finish the steps in your app, then sign in again. |
| `anonymous_session` | The token says the user is anonymous: `is_anonymous: true`, or `isAnonymous: true` on an `oidc` issuer. | Anonymous sign-ins are refused. Ask the person to sign in with an account. |
| `expired` | The token has expired, past 30 seconds of allowance. | Use a fresh token. Clerk session tokens last 60 seconds. |
| `lifetime_exceeded` | `exp` minus `iat` is longer than the issuer's longest token. | Shorten the provider's token lifetime, or raise the issuer's `max_token_lifetime_seconds` by adding a new issuer, since the profile is fixed once saved. |
| `unsupported_algorithm` | The token is signed with an algorithm Lurk does not take, or one you did not choose. | Lurk takes `RS256` and `ES256`. Clerk is `RS256` only. A Supabase project on the legacy shared secret (`HS256`) must move to asymmetric signing keys. |
| `unavailable` | Lurk could not fetch the provider's keys just now. | Open the key address in a browser. It must answer with JSON, with no redirect, within 5 seconds. Try again in a moment. |
| `configuration_changed` | The issuer changed while the test ran. | Run the test again. |

## Token test: verified, but not ready

`access` says whether the token would sign the person in now.

| `access` | What to do |
| - | - |
| `issuer_paused` | Turn the issuer on. A saved issuer is paused until an owner or admin turns it on. |
| `person_blocked` | The person is blocked. Unblock them if that is right. See [Linking people](https://docs.getlurk.com/end-user-auth/linking-people.md#block-and-unblock). |
| `not_yet_available` | Sign-in is not on here, or this is a new person and the project has saved no limit on new people. Save `new_people_per_hour` in **Events people’s apps may send**, under Settings > Sign-in. |

## Setting up the issuer

* **Turning it on is refused.** The last key check must be recent. A generic `oidc` issuer also needs a token test that was `verified` at its current revision, at most 24 hours ago. Run **Check keys** again, run **Test a token** with a real ID token, then turn it on with the revision you read. See [Clerk](https://docs.getlurk.com/end-user-auth/clerk.md#check-the-keys-then-turn-it-on).
* **Check keys shows a problem.** The key address did not answer as Lurk needs. See [other providers](https://docs.getlurk.com/end-user-auth/other-providers.md#how-lurk-fetches-the-keys). A set of more than 20 keys, a repeated `kid` or a private key in the set is refused whole.
* **Saving is refused for an address ending in `.supabase.co` or `.clerk.accounts.dev` as `oidc`.** Use the `supabase` or `clerk` profile.
* **Saving is refused because the issuer is already trusted.** Archive the old one first. See the limit in [other providers](https://docs.getlurk.com/end-user-auth/other-providers.md#add-it-to-lurk).
* **A rename or other change is refused as stale.** Read the issuer again and send the `revision` you read as `expected_revision`.
* **A key or an agent gets `approval_required`.** Adding, turning on, pausing and archiving an issuer, mapping, and blocking are for an owner or admin in person.

## Client API errors

| You see | Check |
| - | - |
| 401 `invalid_key` on every call | Test the token. Check `Authorization: Bearer <token>`, and that no `lurk_` key or member session cookie is on the request. Check the issuer is on and the project ID is yours. |
| 401 for a new person only | The project has saved no limit on new people. Save `new_people_per_hour`. |
| 401 for a person who was fine | The issuer may have been paused or archived. |
| 403 `forbidden` | The person is blocked, or the event name is not on the project's list or can never be sent by a device. |
| 422 on `Lurk-Project` | Send your project ID, `prj_…`, in the `Lurk-Project` header. |
| 422 on an event | A property is not on the list for that name, or a value is outside its clamp, or the properties are over 4,096 bytes. |
| 429 `rate_limited` | Wait `Retry-After` seconds. Over 30 refusals a minute from one address also turns the address away, so stop calling with a token that fails. |
| 503 `unavailable` | Wait `Retry-After` seconds and retry. For an event, reuse the `idempotency_key`. |
| A browser blocks the call | Send only the headers the [Client API](https://docs.getlurk.com/end-user-auth/client-api.md#browsers-and-cors) allows, and do not send credentials or cookies. |

A device does not see every receipt. For a mapped person it sees those from the binding on, and for a merged-away person those from the merge or the link, whichever is later. If a receipt is missing, see [Linking people](https://docs.getlurk.com/end-user-auth/linking-people.md#receipts-a-device-sees).


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