定制 cesar-jr/ci-social 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

cesar-jr/ci-social

最新稳定版本:v0.1.0

Composer 安装命令:

composer require cesar-jr/ci-social

包简介

A package for easy integration of OAuth2 logins

README 文档

README

Packagist Version License PHP Version

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
  • Facebook
  • GitHub
  • GitLab
  • Google
  • LinkedIn
  • Slack
  • Twitch
  • Twitter

🤝 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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2025-08-12