Skip to main content

Embedded cTrader Web

Embedded cTrader Web enables brokers to integrate the full trading platform directly within their client area, providing seamless access to trading functionality without requiring additional authentication. This module eliminates UX disruptions by leveraging existing broker authentication.

Overview

The Embedded cTrader Web module enables:

  • Full trading platform integration within broker client area
  • Single sign-on from broker CRM to cTrader Web
  • iframe-based embedding for seamless user experience
  • Automatic authentication via token exchange
  • Consistent branding and user experience

Prerequisites

Before implementing Embedded cTrader Web, ensure completion of:

Note: Embedded cTrader Web requires long-term accessToken and therefore is only compatible with SSO User creation and authorisation.

Architecture

Integration Options

  1. iframe Embedding: cTrader Web embedded within broker client area
  2. New Tab Launch: cTrader Web opens in separate browser tab
  3. Popup Window: cTrader Web opens in modal/popup window

Authentication Flow

  • Broker CRM generates OT token for authenticated user
  • cTrader Web receives token and validates with backend
  • Token exchanged for long-term access token
  • User authenticated without additional login

Implementation Flow

Flow Diagram

Embedded cTrader Web Flow

Detailed Flow Stages

Stage 1: User Authentication

  1. User authenticates in broker CRM
    • Successful login via broker authentication system
    • User session established in broker client area
    • Authentication context available for token generation

Stage 2: Platform Launch

  1. User initiates cTrader Web launch

    • Clicks "Launch Trading Platform" button
    • Selects trading from broker client area menu
    • Triggers embedded platform request
  2. Broker generates OT token

    • Creates one-time token for user session
    • Associates token with authenticated user
    • Sets token expiration (typically 5-15 minutes)

Stage 3: Platform Loading

  1. cTrader Web opens with token
    • iframe URL: https://app.ctrader.com/info?source=web&token={token}&lang=en&acc={account}
    • Parameters:
      • token: One-time authentication token
      • source: Platform source identifier
      • lang: User language preference
      • acc: Trading account number (optional)
      • theme: Theme preference (light/dark)

Stage 4: Token Exchange

  1. cTrader Web processes token

    • Extracts token from URL parameters
    • Sends authorization request to cTrader backend
    • Initiates token exchange process
  2. cTrader backend validates token

    • API Call: 4.2 - Verify and Exchange OT Token
    • Endpoint: /oauth2/token
    • Authentication: CRM API token
  3. Broker CRM validates and responds

    • Verifies OT token validity and user context
    • Returns userId and accessToken
    • Establishes authenticated session

Stage 5: Session Establishment

  1. cTrader backend authorizes session

    • Creates authenticated session under userId
    • Returns accessToken to cTrader Web application
    • Enables full platform functionality
  2. Application stores access token

    • Saves token for subsequent API calls
    • Maintains session persistence
    • Enables automatic re-authentication
  3. Authorized trading begins

    • User can access all trading features
    • Real-time market data and trading functionality
    • Account management and portfolio access

URL Parameters and Options

Required Parameters

ParameterRequiredDescription
tokenYesOne-time authentication token from broker CRM
sourceYesPlatform source identifier (typically "web")

Optional Parameters

ParameterRequiredDescription
langNoLanguage code (en, es, fr, etc.)
accNoSpecific trading account number
themeNoTheme preference (light, dark)
utm_*NoUTM tracking parameters

Example URLs

<!-- Basic embedded URL -->
<iframe src="https://app.ctrader.com/info?source=web&token=f44bade2-2138-47c2-89e6-ce978bcca028&lang=en"></iframe>

<!-- With account and theme -->
<iframe src="https://app.ctrader.com/info?source=web&token=f44bade2-2138-47c2-89e6-ce978bcca028&lang=en&acc=8003098&theme=dark"></iframe>

<!-- With UTM tracking -->
<iframe src="https://app.ctrader.com/info?source=web&token=f44bade2-2138-47c2-89e6-ce978bcca028&lang=en&utm_source=crm&utm_campaign=trading_launch"></iframe>