teqbylyte/bims-connect

这是一个 Socialite 扩展,提供针对 BIMS(由 TETFund 提供的受益人身份管理服务)的特定认证功能。

v1.0.2 2024-03-31 23:29 UTC

This package is auto-updated.

Last update: 2024-10-01 00:07:43 UTC


README

A laravel package extending Laravel Socialite to provide authentication functionality specific to BIMS - Beneficiary Identity Management Service by TETFund. Visit bims.tetfund.gov.ng to know more.

安装 💻

通过 composer 安装

composer require teqbylyte/bims-connect

配置 ⚙️

您的 BIMS 客户端凭据应放置在您的 config/services.php 文件中,如下所示

'bims' => [
    'client_id' => env('BIMS_CLIENT_ID'),
    'client_secret' => env('BIMS_CLIENT_SECRET'),
    'redirect' => 'https://yoursite.com/callback-url',
],

使用 ✨

要与服务连接,调用包提供的 init 方法,这是一个直接且易于使用的替代方案,用于使用 Laravel Socialite

use Teqbylyte\BimsConnect\BimsConnect;

// Instead of Socialite::driver('bims'), use:
BimsConnect::init()

// Illustration 1:
Route::get('/oauth/redirect', function () {
    return BimsConnect::init()->redirect();
});
 
// Illustration 2:
Route::get('/oauth/callback', function () {
    $user = BimsConnect::init()->user();
 
    // $user->getEmail()
});

访问 Laravel Socialite 了解其他可用方法。

贡献 🛠️

如果您发现此包有任何问题,欢迎您贡献 😄