3.0 KiB
Recordly authentication setup
Recordly uses Supabase Auth for one shared session across email/password and Google. The desktop application uses PKCE and returns from the system browser through a loopback callback in development and recordly://auth/callback in production. X is shown in the sign-in dialog and requires its provider to be enabled in Supabase. SAML is intentionally hidden until configured.
1. Create the project
- Create a Supabase project.
- In Project settings → API, copy the project URL and publishable key.
- Copy
.env.exampleto.env.localand fill in both values. Never use the service-role key in the desktop application. - In Authentication → URL configuration, add
recordly://auth/callbackandhttp://127.0.0.1:43821/auth/callbackto the redirect allow list.
Email/password works once email authentication is enabled and a user has been created. Password-reset emails use the same desktop callback.
2. Google
- Create a Web OAuth client in Google Auth Platform.
- Add Supabase's callback URL,
https://YOUR_PROJECT_REF.supabase.co/auth/v1/callback, as an authorized redirect URI. - Enable Google under Supabase → Authentication → Sign In / Providers and paste the Google client ID and secret.
- Keep the requested scopes to
openid, email, and profile unless Recordly genuinely needs more.
3. X
- Create an OAuth 2.0 app in the X Developer Dashboard and enable requesting the user's email.
- Set its callback URL to
https://YOUR_PROJECT_REF.supabase.co/auth/v1/callback. - Enable X/Twitter OAuth 2.0 in Supabase and paste the client ID and secret.
4. SAML SSO (currently hidden)
SAML is configured per customer workspace. Supabase's SAML support requires Pro or above.
-
Enable SAML in the Supabase Auth provider settings.
-
Obtain the customer's IdP metadata URL or metadata XML file.
-
Register the connection and its email domain with the Supabase CLI, for example:
supabase sso add --type saml --project-ref YOUR_PROJECT_REF \ --metadata-url 'https://customer.example/idp/metadata' \ --domains customer.example
The Recordly modal extracts the domain from the entered email address and starts the matching SAML connection.
5. Verify locally
Restart npm run dev after creating .env.local. Open an editor and verify:
- The account button opens Sign into Recordly.
- Email/password creates a persistent Supabase session.
- Google opens the system browser and returns to Recordly.
- Clicking Create link while signed out opens this modal; after successful authentication it continues to the share dialog.
Add the same SUPABASE_URL and SUPABASE_PUBLISHABLE_KEY values to the share Worker's secrets or variables. Set OWNER_USER_ID to the owner’s Supabase user ID. The Worker validates the access token with Supabase and requires that owner identity before accepting API requests. API_SECRET is server-side only and remains available for library administration and explicitly enabled local integration tests; it is never entered into or exposed by the desktop app.