Skip to main content
OFAuth uses OAuth 2.0 to ask users for permission to share accounts with your app. After approval, your backend (your app’s server) exchanges a one-use code for tokens. PKCE is a security check that protects the code exchange with a secret value called a verifier. The state value ties the callback to the browser session that started the request. Keep the client secret, verifier, and state record on your backend.

Create the authorization request

Build the URL on your backend and send the user to it.
Live consent displays the purpose from your approved app configuration. Renewed consent preserves existing grants; additional permissions apply only to selected accounts. Each parameter may appear once. Unknown or repeated parameters return invalid_request. You do not send resource. If your OAuth client library always sends one, it must be https://api.ofauth.com/v3; any other value returns invalid_request.
Your application saves callback state and the verifier. The Express example binds them to the initiating application user and browser session. Send only the authorization URL to the browser.

Redirect URI rules

Redirect URIs are registered per environment client in the dashboard. The redirect_uri parameter must match a registered value exactly. Use a complete URL with no alternate spelling or formatting. Register the exact string you will send. Each client can have up to 20 redirect URIs.

Open the system browser

Open OFAuth in the browser itself, rather than inside your app’s page. Do not use an iframe or postMessage. Do not send the client secret or PKCE verifier to the browser or native app.

What the user sees

  1. OFAuth establishes current owner authority. Supported guest connection does not require an OFAuth signup.
  2. The user links an OnlyFans account, or chooses accounts they or their organization already linked.
  3. The user approves the scopes you requested for the chosen accounts.
  4. OFAuth redirects to your callback.
A linked account belongs to its owner, not to your integration. The owner can share the same account with several apps, and can revoke your access from the OFAuth dashboard at any time.

Accounts linked later

The consent screen can offer the owner Also share accounts I link later. It is off by default and hidden for guests. If the owner turns it on, accounts are added to your authorization with the scopes they approved, and you receive authorization.updated with reason: "auto_added":
  • In Live, each OnlyFans account the owner newly links afterwards is added.
  • In Test, only accounts designated as test accounts are added, when they are designated, and only if they were linked after auto-add was turned on.
  • Only new accounts are added. Reconnecting an existing account does not add it, and an account the owner removed from your authorization is never added back.
  • The owner can turn the setting off from the third-party apps page in their dashboard. Accounts already shared stay shared.

Handle the callback

OFAuth returns only to the exact registered redirect URI. If the request cannot be tied to a registered redirect URI, OFAuth shows the error instead of redirecting (invalid_request, invalid_scope, unauthorized_client, or access_denied with a reason). The authorization code expires after 5 minutes and is single-use. Your app or auth framework stores state with the initiating user and browser session and accepts it only once. Reject mismatched sessions without consuming a legitimate attempt. Validate iss against https://api.ofauth.com/v3/link. Perform these checks before exchanging the code.
TypeScript SDK

Return to a native app

The native app asks its backend for the authorization URL. It opens that URL in ASWebAuthenticationSession or a Custom Tab. After the HTTPS callback, the backend can open a one-use Universal Link or App Link. Put only a random reference to your app’s sign-in attempt in that link. The reference must not reveal any credentials. Keep the authorization code, OAuth state, tokens, client secret, and PKCE verifier on the backend. Do not use a custom URL protocol. Do not send OFAuth directly to a native callback. Do not exchange tokens from a public native client.

Requesting more scopes or accounts later

Request the additional scopes your feature needs. Existing creator grants and accounts stay shared. The owner selects which accounts receive the new scopes; unselected accounts keep their existing permissions. Removing access is a separate action in OFAuth. The authorization keeps its authorization_id, and you receive authorization.updated with reason: "consent_updated". Access calls that need a scope you have not been granted fail with missing_scope or additional_consent_required. See Errors.