What Lurk requires of a Clerk token
- It is a version 2 session token: it carries
sid,vset to2andstsset toactive. - It is signed with
RS256. - Its
azpclaim (the origin of your app, as Clerk records it) is exactly one of the origins you list. - It carries no
aud, unless you list audiences. If you list some, it must carry exactly one of them. - It is refused as a pending session when
stsispending, which Clerk uses when someone has not finished joining an organization.
azp or aud, because it is not tied to a session. A version 1 session token is refused too. No setting turns these on.
A request from a client that sends no Origin header can produce a token with no azp. Lurk refuses it.
What you need from Clerk
The Frontend API address must be written exactly as Clerk puts it in
iss: HTTPS, lower case, no port, no path and no query. A trailing slash is refused when you save it.
A development instance may also list http://localhost or http://127.0.0.1, with an optional port. A production instance may not.
Add it to Lurk
An owner or admin does this, in person. In the dashboard, open Settings, then the Sign-in tab, and choose Add a provider. Or callPOST /v1/trusted-issuers as a member.
The issuer is saved paused. Its address cannot be edited later. To change it, add a new issuer.
A Clerk development address (
*.clerk.accounts.dev) cannot be saved with the oidc profile. Use clerk.
Check the keys, then turn it on
- Check keys. In the dashboard, choose Check keys. Or
POST /v1/trusted-issuers/{id}/checkwith theexpected_revisionyou read from the issuer. Lurk fetches the keys from<issuer>/.well-known/jwks.jsonand saves what it found. - Turn it on. Choose Turn on, or
POST /v1/trusted-issuers/{id}/activatewithexpected_revision. It is refused unless the last check is at the current revision and at most 24 hours old. - Allow new people. A person who has never signed in is refused until the project saves a limit on new people per hour (
new_people_per_hour, 1 to 1,000) in the dashboard, under Settings > Sign-in, in Events people’s apps may send. Also list the event names a device may send. The list is empty by default. See Client API.
Test it
Sign in to your app, take the session token Clerk gives it, and test it against the issuer. In the dashboard, choose Test a token on the issuer and paste it. See Linking people. A good answer isverified, with identity linked or unlinked and access ready. A refusal names the claim that failed: wrong_authorized_party means azp is not in your list, pending_session means the session is not finished, and wrong_audience means the audience does not match. A JWT-template token is answered as invalid_token.
Clerk session tokens live for 60 seconds, so paste a fresh one. See Troubleshooting.