What you need from Supabase
- Asymmetric signing keys. Lurk verifies the token against your project’s public keys. A project that still signs with the legacy shared secret (
HS256) has no keys to fetch, and its tokens are refused asunsupported_algorithm. Move the project to asymmetric signing keys in Supabase first. - Your project ref. It is the 20 lower-case letters at the start of your project address,
https://<ref>.supabase.co.
What Lurk requires of a Supabase token
is_anonymousis present and is the booleanfalse. A person signed in anonymously (true) is refused asanonymous_session. A token without the claim, or with a value that is not a boolean, is refused asinvalid_token. A Custom Access Token Hook can remove the claim, so do not remove it.role, if present, isauthenticated. The project’sanonandservice_rolekeys are refused.- It meets the common rules in the overview.
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, and its address cannot be edited later.
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 key set and saves how many usable keys it found. A problem is shown on the issuer. - Turn it on. Choose Turn on, or
POST /v1/trusted-issuers/{id}/activatewithexpected_revision. The last check must be recent: see Clerk. - Allow new people and events. Save
new_people_per_hour(1 to 1,000) and the event names a device may send in Events people’s apps may send, under Settings > Sign-in. Without a limit on new people, a person who has never signed in is refused. See Client API.
Test it
Sign in to your app as a real user, copy the access token Supabase gave it, and test it. In the dashboard, choose Test a token on the issuer and paste it. See Linking people. A good answer isverified with access ready. Anonymous users answer anonymous_session. A token for another project answers wrong_issuer. If nothing matches, see Troubleshooting.