Skip to content

Connect flow

View as Markdown

This page covers the Connect protocol: the browser-mediated Sudomimus flow used when your application wants direct control over the login round-trip. Connect speaks JSON over HTTPS, so any backend language with an HTTP client works; examples below are in curl, Node.js, Python, and Go.

If you’re building a native client (desktop, game, CLI), see Native clients. For OIDC, see OIDC relying parties.

Tabs are synchronised across the page: pick your language once and every block below switches with it.

PhaseInitiatorEndpointResult
1. EstablishApplication backendconnect-api POST /establish{ exposureKey, hiddenKey }
2. AuthenticateBrowservia.sudomimus.comThe user completes an allowed challenge
3. RedeemApplication backendconnect-api POST /redeem{ accessToken, refreshToken }
4. RefreshApplication backendconnect-api POST /refreshA new access token and rotated refresh token

Three parties split responsibility:

  • Your backend signs /establish, stores hiddenKey, redeems the completed inquiry, and verifies the resulting tokens.
  • The browser carries exposureKey to the hosted authentication UI but never sees hiddenKey.
  • via.sudomimus.com runs the passkey, email OTP, OAuth, or federation challenge and creates confirmationKey only after authentication succeeds.

This lifecycle is specific to Connect. OIDC uses authorization code + PKCE, while native direct-issue exchanges a Steam ticket or AccessKey in one request.

Your backend asks Connect to open an authentication session. The response gives you an exposure key (passed to the browser) and a hidden key (kept on the server).

Terminal window
curl -X POST https://connect-api.sudomimus.com/establish \
-H "Content-Type: application/json" \
-H "Authorization: SudomimusClientJWT $SUDOMIMUS_CLIENT_AUTH_JWT" \
-d '{
"applicationAnchor": "your-application",
"returnMethods": [
{
"type": "CALLBACK",
"payload": { "callbackUrl": "https://your-app.com/auth/callback" }
}
]
}'

Store hiddenKey against the user’s pending session (e.g. in a server-side store). Send the user to via.sudomimus.com with the exposureKey in the URL.

2. Authenticate — hand off to via.sudomimus.com

Section titled “2. Authenticate — hand off to via.sudomimus.com”

Redirect the user’s browser to via.sudomimus.com with the exposure key. The user completes the passkey or email-OTP challenge there.

# No HTTP call — this is a 302 redirect from your application:
Location: https://via.sudomimus.com/?exposure-key=<exposureKey>

When the user finishes, via.sudomimus.com redirects the browser to your callbackUrl with exposure-key and confirmation-key appended as query parameters.

In your callback handler, combine the three keys and exchange them at Connect for an access token plus a refresh token.

Terminal window
curl -X POST https://connect-api.sudomimus.com/redeem \
-H "Content-Type: application/json" \
-d '{
"exposureKey": "...",
"hiddenKey": "...",
"confirmationKey": "..."
}'

The access token is a signed JWT. Verify it using your application’s token-signing public key — fetched once from POST /info and cached — then trust its claims. See Tokens and verification for the full verification recipe, including the kty: "Access" header check.

Before the access token expires, exchange the refresh token for a fresh access token and a new refresh token. /refresh does not require a client-auth JWT. Refresh tokens are rotated — the token you present is consumed, and the response returns its replacement. Persist the new refreshToken and use it for the next refresh; re-using a spent one revokes the whole session. Near-simultaneous concurrent refreshes of the same token (e.g. multiple tabs) are tolerated and converge on one session; only reuse after the replacement has been issued revokes it.

Terminal window
curl -X POST https://connect-api.sudomimus.com/refresh \
-H "Content-Type: application/json" \
-d '{ "refreshToken": "..." }'

For introspection, logout, and account-wide revocation, see Managing sessions.

POST /info returns the public profile of an application (name, public key, localized name) given its anchor. It does not require a client-auth JWT, so it is safe to call from browsers and untrusted contexts.

Terminal window
curl -X POST https://connect-api.sudomimus.com/info \
-H "Content-Type: application/json" \
-d '{ "applicationAnchor": "your-application", "locale": "en-US" }'

The applicationPublicKey returned by /info is the key your backend uses to verify access tokens for this application. Cache it; refetch only after key rotation.