On this page
Auth
What Auth serves, the keys it uses, and how a sign-in reaches your app.
Auth signs in the people who use your app. They are end users: a record in your environment, never a Sylphx account. Auth holds their passwords (hashed and checked against breached passwords), their sessions and their sign-in history, so your app does not.
You work with Auth in two places.
- Your server manages end users and their sessions through the API at
https://api.sylphx.com/v1, with your secret key. - Your pages sign users in through the client API at
https://api.sylphx.com/v1/client, with a publishable key that is safe to ship in a browser.
What is served
| Method | Status |
|---|---|
| Email and password, with sign-up and an email verification link | Served. |
| Google, on Sylphx's shared Google client | Served. Nothing to set up in the Google console. |
| Google, GitHub and Apple on your own client | Served. GitHub and Apple need your own client: Sylphx has no shared GitHub or Apple client. |
| A TOTP second factor at sign-in | Served for a user who has an active factor: password sign-in then needs a totp or recovery_code proof. |
| Hosted sign-in, consent and device approval pages | Served, on the Account Portal. |
| Magic link, email code and passkeys | Use GET /v1/client/config to show only the methods enabled for your environment. |
When you bring your own Google, GitHub, Apple, Microsoft or Facebook client
and have a verified custom Account Portal, register exactly
{portal_url}/oauth/callback with the provider. portal_url includes any mount
path. Shared clients and instances without a verified custom portal use
https://api.sylphx.com/v1/oidc/callback.
The two keys
- Publishable key
- sylphx_pk_live_… or sylphx_pk_test_…, scope auth:public. For the client API. Public by design.
- Secret key
- sylphx_sk_…, scope auth:read and auth:write. For end_users and sessions. Server only.
The platform delivers SYLPHX_PUBLISHABLE_KEY to every environment's services at
runtime, not at build time. Read it on your server and pass it to the page.
How a sign-in reaches your app
- The page reads
GET /v1/client/config?publishable_key=…: the enabledmethods, thesocialproviders with theirstart_url, and your branding. - The user signs in. Password:
POST /v1/client/sign-in/password. Social: append your app'sredirect_urlto the provider'sstart_url, preserving any existing query parameters. For an API-hosted start, also append the publishable key. A verified custom portal start already names the instance; it does not need the key. - With the default
session_mode: "server", the page receives a one-time ticket (two minutes, one use), asauth_ticketon yourredirect_urlor in the password answer. Your server redeems it withPOST /v1/client/tickets:redeemand keeps the session in anHttpOnlycookie. No bearer token is ever readable by page script. Apps with no backend usesession_mode: "browser"and hold the session bearer. GET /v1/client/sessionreturns the current session and user, andPOST /v1/client/sign-outends it.
An error is a JSON object with a stable code: invalid_request,
unauthorized, mfa_required, forbidden, not_found, conflict,
locked_out (with Retry-After), rate_limited, internal and
store_unavailable. mfa_required means the user has a second factor: send it
as factor_proofs on the next password sign-in. Sign-up always answers
202 {"accepted": true}, whether or not the email already has an account.
Manage end users from your server
sylphx auth end-users list orgs/acme/projects/shop/envs/production
sylphx auth sessions list orgs/acme/projects/shop/envs/production/end_users/<user>
sylphx auth end-users revoke-sessions orgs/acme/projects/shop/envs/production/end_users/<user>Deleting an end user is revocation: every session ends and new sign-ins are refused. The quickstart creates, reads and deletes one.
Sign in a CLI or an agent: the device flow
For a program with no browser form, create an OAuth client
in your environment and enable the device grant (RFC 8628). The client calls
POST https://api.sylphx.com/v1/oauth/device_authorization and receives a
device_code, a short user_code and a verification_uri: the Account
Portal's /device page. The user opens …/device?user_code=ABCD-EFGH
(?code= works too) or opens /device and types the code, signs in, and
approves or denies. The program polls POST /v1/oauth/token with the device
grant until it is approved. sylphx login uses the same pattern against
sylphx.com/device.