This page documents the authentication and authorization flow, which is common to every integration. Partner-specific steps that follow it — issuing a long-lived non-interactive token, associating a partner account with an eToro account, and reporting events back to eToro — are covered in the Partner integration flow.
Standards conformance
This is not an eToro-specific handshake. eToro’s SSO service is a conformant OpenID Connect 1.0 provider built on the OAuth 2.0 authorization framework. It is therefore implemented with the same client library used for any other identity provider: the library is configured with the issuerhttps://www.etoro.com and derives its endpoints and signing keys from the discovery document.
eToro recommends the use of an established, certified client library — for example
openid-client or jose on Node.js, Microsoft.AspNetCore.Authentication.OpenIdConnect on .NET, Spring Security OAuth2 Client on Java, or Authlib on Python. A custom protocol implementation is a common source of authentication defects, and none of the steps described below require one.
Discovery document
eToro publishes a standard OpenID Connect discovery document. Endpoint URLs and signing keys should be resolved from it at runtime rather than hardcoded: signing keys are rotated, and the document is the authoritative source.https://www.etoro.com
The exact string your ID token validation must require in the
iss claim.code
Authorization code flow only. The implicit and hybrid flows are not offered — never request
token or id_token as a response type.S256
PKCE with SHA-256.
plain is not supported.RS256
ID tokens are signed with RS256. Reject any token whose header declares a different algorithm, and never accept
alg: none.pairwise
The
sub claim is a pairwise pseudonymous identifier — it is specific to your client. The same eToro user presents a different sub to a different application, and it carries no personal information. This is the identifier to store.authorization_code, refresh_token, client_credentials, urn:ietf:params:oauth:grant-type:token-exchange
Which of these your client may use is decided per application at registration.
client_secret_basic, client_secret_post, private_key_jwt, none
A confidential client — any application with a backend — must authenticate. Use
client_secret_basic or private_key_jwt. none exists for public clients that cannot hold a secret.Prerequisites
1
Register your application
Registration produces a
clientId and a clientSecret, and establishes the redirect URIs and the scope set the application may request. Register through the eToro Builders portal, or programmatically with POST /api/v1/sso/applications.The clientSecret is returned exactly once, at creation. It is never readable again — only replaceable, via POST /api/v1/sso/applications/{clientId}/client-secret, which invalidates the previous secret immediately with no overlap window.2
Pick your scopes
GET /api/v1/sso/scopes returns the catalog of scopes the client may request. Request the narrowest set that completes the intended user journey. Each endpoint in the API reference lists the scopes that grant access to it, and a token requires only one of the alternatives listed on an operation, not all of them.3
Register your redirect URIs
Each redirect URI is matched exactly at authorization time. Register the HTTPS callback served by your backend, rather than a URL that renders the authorization code into a browser page.
Step 1 — Redirect the user to eToro
Generate a distinct PKCEcode_verifier, state, and nonce for each authorization attempt, retain them server-side against the browser session, and redirect the user to the authorization endpoint.
eToro authenticates the user, presents the consent screen for the scopes registered to the application, and redirects to the registered
redirect_uri with code and state.
Step 2 — Exchange the code for tokens
This call is made server to server from your backend, authenticated with the client credentials. The authorization code is single-use and short-lived.The access token authenticates API calls as
Authorization: Bearer <access_token>. The ID token is not an API credential: it is an assertion of who authenticated, to be verified by your backend and then discarded or retained as a claim record. An ID token must never be sent to the API.Step 3 — Validate the ID token
The ID token is the only element of this flow that identifies which user signed in, and its validation is therefore the security boundary of the integration. Retrieve the signing keys from the JWKS URI, cache them bykid, and refresh on an unknown kid.
Verify each of the following, and fail closed on any failure:
- Signature against the JWKS key whose
kidmatches the token header, withalgRS256. issequalshttps://www.etoro.comexactly.audcontains yourclientId.expis in the future andiatis not implausibly old (allow only small clock skew).nonceequals the nonce you issued for this authorization attempt.subis present. This is your user key.
jwks_uri from the discovery document, cache the key set with a short TTL, and re-fetch it when a token presents an unknown kid. Keys must not be pinned by value.
Calling the API with the token
The access token is presented asAuthorization: Bearer <access_token>, together with the x-request-id header required on every call:
Identity and personal data
Thesub claim is the identity anchor for the integration. It is pairwise: a given eToro user presents a different sub value to each registered client, so the identifier is stable for your application, meaningless to anyone else, and carries no personal information.
Design around it:
- Identity is the
subclaim. Use it as the primary key associating your user record with the eToro user, and resolve it on every subsequent sign-in. - Authorization is the scope set on the token. Never infer entitlement from anything the user typed into your application.
- No PII joins. Do not build account matching, reconciliation, deduplication, or support lookups on email address, name, or phone number. Beyond being unavailable by default, matching on user-supplied attributes is an account-takeover vector: any party able to register that value in your application would inherit the corresponding eToro account.
- A scope is permission to call, not permission to receive PII. Where an operation would return personal data, a separate data-sharing approval governs what is returned.
Token lifecycle
~1 hour
Refresh it with
grant_type=refresh_token at the token endpoint, using the same client authentication as Step 2. Refresh on a 401, and pre-emptively before expiry for long-running jobs.long-lived
Store it encrypted, one per user per client. Revoke it at
https://www.etoro.com/api/sso/v1/token/revoke when a user disconnects your application.until rotated
Rotate with
POST /api/v1/sso/applications/{clientId}/client-secret. The previous secret stops working the moment the call returns, so deploy the new one in the same window.An access token is bound to the user’s interactive session. For backend work performed while the user is not present, a long-lived non-interactive token is issued instead — see Issue a non-interactive token.
Security checklist
The following must be in place before an integration is promoted to production:- PKCE
S256on every authorization request — no exceptions, including for confidential clients. stateverified against the browser session on every callback;nonceverified inside every ID token.- Exact-match redirect URIs, HTTPS, pointing at your backend.
- ID token signature,
iss,aud,exp, andnonceall verified, withalgrestricted to RS256 and JWKS keys fetched bykid. - Client secret and refresh tokens held in a secret store — never in source, never in a repository, never in a log line, never in an error payload, never returned to the browser.
- A working revocation path for the refresh token, wired to your own user-offboarding flow.
x-request-idset to a fresh UUID on every API call, so a failure is traceable end to end across both systems.- No PII in the account association, the logs, or the analytics.
Reference
Partner integration flow
Non-interactive tokens, account association, event reporting, and the data-sharing rules.
API keys and headers
The
x-api-key / x-user-key pair and request header format.Builders portal
Register your application and manage credentials.
Rate limits
Quotas that apply to every call in this flow.