Skip to main content
Keep your app’s client secret and sign-in checks on your server, also called the backend. Account owners approve access on an OFAuth page. Your app can use only the accounts and permissions they share.

Which accounts a token can access

An access token belongs to one authorization: the accounts and permissions an owner approved. It also belongs to one mode, such as Sandbox or Live. The x-linked-account-id header selects one of those accounts. The ID alone does not grant access. The linked-account list shows only accounts shared through that authorization. Removing an account from the list ends access through that authorization. It does not delete the OnlyFans account or remove access through other authorizations.

Keep each value in the right place

Before using an account, check the callback’s state and exchange its code on your server. Receiving a callback alone does not prove that access was approved.

Protect the callback

PKCE protects the callback code with a secret created for each sign-in attempt. Use the required S256 method and the exact callback URL registered for your app. state is a random value that ties the callback to the browser session that started sign-in. Save it with that session and accept it only once. Reject missing, expired, changed, or reused values. Authorization codes work once and expire after five minutes. Exchange the code on your server. Keep the PKCE verifier and client secret out of browsers and mobile app storage. See Authorize.

Protect tokens

Access tokens are opaque Bearer secrets with a 15-minute lifetime. Refresh tokens stay stable and expire after 90 days without successful authenticated refresh. They are restricted to confidential clients. Independent backend instances can refresh concurrently and retry a lost response. Stable refresh has a security tradeoff: a stolen refresh token plus client secret can renew until revocation or expiry. An access token can be replayed without a secret until expiry or server-side revocation. Store both privately and protect normal registration changes with conditional writes. Keep secrets out of logs and tokens out of URLs. Reject authenticated resource redirects, including 307 and 308. Send client secrets and refresh tokens only to their designated OAuth endpoints. See Tokens.

Check access in your app

Before each API call, check that the user in your app can use the saved account access. Ask for only the permissions your feature needs. Keep Sandbox, Test, and Live credentials and account records separate. Check webhook signatures before acting on account or access changes. Stop using access when an owner removes an account or ends approval. Use revoke to end a credential, or remove a linked account to end access to just one account.