cesar-jr / ci-social
A package for easy integration of OAuth2 logins
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/cesar-jr/ci-social
Requires
- php: ^7.4 || ^8.0
- codeigniter4/framework: ^4.0
- firebase/php-jwt: ^6.11
- guzzlehttp/guzzle: ^7.9
- phpseclib/phpseclib: ^3.0
This package is auto-updated.
Last update: 2025-12-14 22:36:31 UTC
README
CI Social is a CodeIgniter 4 package shamelessly copied from inspired by Laravel Socialite, enabling seamless OAuth authentication with multiple providers.
Currently supports: Bitbucket, Facebook, GitHub, GitLab, Google, LinkedIn, Slack, Twitch, and Twitter.
📦 Installation
Install via Composer:
composer require cesar-jr/ci-social
⚙️ Configuration
After installation, publish the configuration file:
php spark social:setup
This will create:
app/Config/Social.php
Add your provider credentials:
public array $providers = [ 'github' => [ 'client_id' => 'your-client-id', 'client_secret' => 'your-client-secret', 'redirect' => '/callback/github', ], 'google' => [ 'client_id' => 'your-client-id', 'client_secret' => 'your-client-secret', 'redirect' => '/callback/google', ], // ... other providers ];
🚀 Basic Usage
You can use either the helper or service to start the OAuth flow.
1. Redirecting to the provider
Using helper:
return social('github')->redirect();
Using service:
return service('social')->driver('github')->redirect();
2. Getting the user after callback
$user = social('github')->user(); // Available user data $user->getId(); $user->getName(); $user->getEmail(); $user->getAvatar();
🌐 Supported Providers
- Bitbucket
- GitHub
- GitLab
- Slack
- Twitch
🤝 Contributing
Pull Requests are welcome!
If you find a bug, please open an issue with details and reproduction steps.
📄 License
This project is licensed under the MIT License.