Keep provider tokens
Let your server call a provider's API as the person, with the tokens Synq keeps for you, and make a provider one people only link.
When someone signs in with a provider, or adds it to their account, the provider hands Synq an access token for them, and often a refresh token. Synq keeps neither unless you ask. A brand can turn Tokens on for a provider, and its server can then read a fresh access token for any person who linked that provider, to call the provider's API as them.
Say Acme Guild wants to post a member's event check-ins on X for them. Acme Guild brings its own X app, turns Tokens on for X, and its server reads each member's X access token when it posts.
Turning it on
Tokens are kept only through your own app at the provider, the brand's or the org's (your own apps at the providers). Tokens that Synq's shared app gets never go to a tenant, so without your own app it's refused with own_app_required, and a sign-in that still goes through Synq's app keeps none.
- In the dashboard: the brand's sign-in methods, the provider, Tokens: keep people's tokens for your server.
- With the management API:
PATCH /v1/orgs/{org}/brands/{brand}/sign-in-providers/{provider}with{ "keep_tokens": true }, andorg.brands.edit.
Turning it on wants a sign-in from the last 5 minutes for a person (fresh_sign_in_required); an API key never does. It's recorded as brand.updated, naming sign_in_providers.<provider>.keeps_provider_access, since an audit entry never names a credential. Turning it off deletes every token kept at that provider in the brand, at once.
Tokens are kept from the next sign-in or link with the provider: each one replaces what was kept before. Where a provider gives a refresh token only when asked, Synq asks for one while Tokens is on: Microsoft's offline_access, X's offline.access and Google's access_type=offline. Google gives one only the first time the person agrees to your app; Synq keeps it across later sign-ins through the same app.
Reading a token
Your server reads the person's access token with an org API key that has org.users.providerTokens.read. $SYNQ_API here is the management API, https://api.synq.build:
curl -X POST \
-H "Authorization: Bearer $SYNQ_API_KEY" \
"$SYNQ_API/v1/orgs/$ORG/brands/$BRAND/users/$USER/identities/$IDENTITY/access-token"{
"access_token": "…",
"scope": "tweet.read users.read offline.access",
"expires_at": "2026-11-09T14:00:00.000Z"
}GET …/users/{user}/identities lists the person's linked accounts with each one's id, and provider_tokens says whether tokens are kept for it, what they grant, when the access token expires and whether Synq can refresh it, never the tokens themselves.
- Fresh: an access token that expires within a minute is refreshed first, with your app, where a refresh token is kept. The refresh token itself never leaves Synq.
- Server only: only an org API key reads one. A person's access token, the dashboard's included, and any request a browser sends (with an
OriginorSec-Fetch-Siteheader) is refused withserver_only. The account API never has them. - Audited: every read is recorded as
user.provider_token_read, with whether Synq refreshed it, and limited per org. - Revoked: when the provider refuses a refresh, because the person took your app's access back there or the tokens were issued to an app that's no longer yours, Synq deletes them, records
user.identity_token_revoked(a webhook event) and answersprovider_token_revoked. Ask the person to sign in or link the provider again. - Gone with the account: unlinking the provider, or deleting the user, deletes the tokens with it.
Store nothing you read longer than you need it, and never put a token in a browser, a log or a URL.
Where tokens are of little use
Tokens are only worth what the provider lets them do:
- Telegram: an access token lasts an hour, and there's no refresh token. Once it expires, reading it answers
provider_token_unavailableuntil the person signs in again. A bot's own token, withtelegram:bot_access, is usually what you want instead (ask a provider for more). - Facebook: no refresh token; its token lasts about 60 days.
- Apple: its tokens give access to nothing beyond who the person is.
- Any provider: a token carries only the scopes the sign-in asked for: Synq's minimum, and the extra scopes the brand asks for (ask a provider for more).
Keeping claims
A brand can also keep claims the provider says of the person, by name, with kept_claims (Kept claims in the dashboard): an OpenID Connect provider's ID token claims, or an OAuth 2.0 provider's user endpoint fields (X's inside its data). Up to 16, kept on each identity as the provider said them at the last sign-in or link, 4 KB at most altogether, and listed as claims in GET …/users/{user}/identities. The protocol's own claims (iss, aud, nonce…) and anything named like a credential are refused.
Providers people only link
A provider can be for linking only: set Use for to Linking only, or { "use": "link_only" }. People add their account there to the account they have, from your app's account page or the hosted link flow, and see it there; they never sign in or sign up with it, and it doesn't count as a way in, so it can't be someone's last one. It's left out of useSignInMethods() and stays in useLinkableMethods(), and its tokens and claims are kept the same way. Recorded as brand.updated, naming sign_in_providers.<provider>.use.
Ask a provider for more
Choose the extra scopes a brand asks each sign-in provider for, such as a Telegram phone number or permission for your own bot to message people.
Your own sign-in providers
Add any OpenID Connect issuer or OAuth 2.0 server as a way to sign in at a brand, through your own app there.