PHPackages                             serenity\_technologies/socialite-ctrader - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. serenity\_technologies/socialite-ctrader

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

serenity\_technologies/socialite-ctrader
========================================

cTrader Socialite Provider for Laravel Socialite.

v0.1.2(1mo ago)017↓12.5%MITPHPPHP ^8.1|^8.2|^8.3|^8.4

Since Jun 14Pushed 1mo agoCompare

[ Source](https://github.com/Serenity-Technologies/socialite-ctrader)[ Packagist](https://packagist.org/packages/serenity_technologies/socialite-ctrader)[ RSS](/packages/serenity-technologies-socialite-ctrader/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (10)Versions (5)Used By (0)

cTrader Socialite Provider
==========================

[](#ctrader-socialite-provider)

This is a [cTrader](https://ctrader.com/) Socialite provider for [Laravel Socialite](https://socialitejs.com/).

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require serenity_technologies/socialite-ctrader
```

The package requires the `google/protobuf` library to communicate with the cTrader Open API binary protocol.

Configuration
-------------

[](#configuration)

Add the configuration to your `config/services.php` file:

```
'ctrader' => [
    'client_id'     => env('CTRADER_CLIENT_ID'),
    'client_secret' => env('CTRADER_CLIENT_SECRET'),
    'redirect'      => env('CTRADER_REDIRECT_URI'),

    // Optional: Protobuf Socket Settings
    'base_host'     => env('CTRADER_BASE_HOST', 'live.ctraderapi.com'), // Use demo.ctraderapi.com for Demo
    'base_port'     => env('CTRADER_BASE_PORT', 5035),
    'timeout'       => env('CTRADER_TIMEOUT', 5),
    'verify_peer'   => env('CTRADER_VERIFY_PEER', true),
    'allow_self_signed' => env('CTRADER_ALLOW_SELF_SIGNED', false),
],
```

### Advanced Settings

[](#advanced-settings)

- `base_host`: Default is `live.ctraderapi.com`. Change to `demo.ctraderapi.com` for the Sandbox/Demo environment.
- `timeout`: Connection and read timeout in seconds (default: 5).
- `verify_peer`: Set to `false` if your server has issues verifying SSL certificates (not recommended).
- `allow_self_signed`: Set to `true` if using a proxy with self-signed certificates.

### Laravel Octane / FrankenPHP Compatibility

[](#laravel-octane--frankenphp-compatibility)

This provider is fully compatible with Laravel Octane and FrankenPHP. It automatically refreshes the request instance to avoid stale state issues common in persistent worker environments.

### Registration

[](#registration)

You will need to register the provider using the `SocialiteExtendSocialite` event. Add the listener to your `app/Providers/EventServiceProvider.php`:

```
protected $listen = [
    \SocialiteProviders\Manager\SocialiteWasCalled::class => [
        \SocialiteProviders\Ctrader\CtraderExtendSocialite::class.'@handle',
    ],
];
```

Usage
-----

[](#usage)

You can now use the provider like any other Socialite provider:

```
use Laravel\Socialite\Facades\Socialite;

// Redirect to cTrader for authorization
return Socialite::driver('ctrader')->redirect();

// Receive the callback from cTrader
$user = Socialite::driver('ctrader')->user();

// Access user details
$userId = $user->getId();
$email = $user->getEmail(); // Generated as {userId}@ctrader.com
$token = $user->token;
```

### Scopes

[](#scopes)

By default, the provider uses the `accounts` scope. You can change this or add more scopes:

```
return Socialite::driver('ctrader')
    ->scopes(['trading'])
    ->redirect();
```

User Profile Retrieval
----------------------

[](#user-profile-retrieval)

Unlike many other Socialite providers, cTrader does not provide a standard REST endpoint for user profile information. This provider automatically handles this by:

1. Exchanging the authorization code for an access token via REST.
2. Connecting to the cTrader Open API gateway via an SSL TCP socket.
3. Sending a `ProtoOAGetCtidProfileByTokenReq` message to retrieve the unique cTrader User ID.
4. Mapping this ID to the Socialite User object and generating a `{userId}@ctrader.com` email address.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance90

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

46d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/99ddbbb67396f6e60e5e14f1836686788ce5bc6f83f1c44577266cd12dcd29a8?d=identicon)[kwadwokyeremeh](/maintainers/kwadwokyeremeh)

---

Top Contributors

[![kwadwokyeremeh](https://avatars.githubusercontent.com/u/20841644?v=4)](https://github.com/kwadwokyeremeh "kwadwokyeremeh (10 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/serenity-technologies-socialite-ctrader/health.svg)

```
[![Health](https://phpackages.com/badges/serenity-technologies-socialite-ctrader/health.svg)](https://phpackages.com/packages/serenity-technologies-socialite-ctrader)
```

###  Alternatives

[leantime/leantime

Open source project management system for non-project managers. Simple like Trello, powerful like Jira. Built with neurodiversity in mind.

10.2k4.0k](/packages/leantime-leantime)[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[dutchcodingcompany/filament-socialite

Social login for Filament through Laravel Socialite

2191.1M11](/packages/dutchcodingcompany-filament-socialite)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

85036.3k](/packages/flow-php-flow)[kovah/laravel-socialite-oidc

OpenID Connect OAuth2 Provider for Laravel Socialite

24138.3k](/packages/kovah-laravel-socialite-oidc)[clarifai/clarifai-php-grpc

Clarifai PHP gRPC client

1229.7k](/packages/clarifai-clarifai-php-grpc)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
