cesar-jr/ci-social
最新稳定版本:v0.1.0
Composer 安装命令:
composer require cesar-jr/ci-social
包简介
A package for easy integration of OAuth2 logins
关键字:
README 文档
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.
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2025-08-12