承接 wjbecker/filament-connectify 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

wjbecker/filament-connectify

最新稳定版本:0.0.1

Composer 安装命令:

composer require wjbecker/filament-connectify

包简介

Filament Connectify - Social Login through Laravel Socialite

README 文档

README

Add OAuth2 Login support to Filament v3 through Laravel Socialite

This package extends Laravel Socialite. Socialite currently supports authentication via Facebook, Twitter, LinkedIn, Google, GitHub, GitLab, and Bitbucket out of the box.

Refer to the Socialite documentation for more information on how to configure your application to use these providers.

Many other providers are available via the Socialite Providers website. Refer to the documentation for each provider for information on how to configure your application to use them.

Installation

Install package via composer:

composer require wjbecker/filament-connectify

Publish & migrate migration files

php artisan vendor:publish --tag="filament-connectify-migrations
php artisan migrate

To use provider icons you can add Blade Font Awesome brand icons

composer require owenvoke/blade-fontawesome

Provider Configuration

Refer to the Socialite documentation for more information.

Panel Configuration

Include this plugin in your panel configuration:

use Wjbecker\FilamentConnectify\FilamentConnectifyPlugin;

return $panel
    // ...
    ->plugins([
        // ... Other Plugins
        FilamentConnectifyPlugin::make()
            // (required) add providers
            ->providers([
                'azure' => [
                    'label' => 'Continue with Microsoft',
                    'icon' => 'fab-microsoft', // requires additional package
                ]
            ])
            // (optional) restrict login callback
            ->isAllowedCallback(function (\SocialiteProviders\Manager\OAuth2\User $socialiteUser) {
                $decodedToken = json_decode(base64_decode(str_replace('_', '/', str_replace('-','+',explode('.', $socialiteUser->token)[1]))));
                return $decodedToken->tid === {{azure_tenant_id}};
            })
            // (optional) change the user model class
            ->userModel(\App\Models\User::class)
            // (optional) change redirect url callback
            ->redirectUrlCallback(function ($provider) {
                return 'https://'.tenant('id').'.foo.test'.route(FilamentConnectifyPlugin::get()->getCallbackRoute(), $provider, false);
            })
    ])

Sample Provider Configuration - Azure Active Directory

To start, You would refer to the documentation for the Azure Socialite Provider.

Normally, you would follow the providers documentation on the aforementioned link but to demonstrate, I'll include the steps here.

Per their documentation, you would install the community Azure provider via

composer require socialiteproviders/microsoft-azure

Then you would configure your config/services.php file to include the Azure provider's credentials:

'azure' => [    
  'client_id' => env('AZURE_CLIENT_ID'),
  'client_secret' => env('AZURE_CLIENT_SECRET'),
  'redirect' => env('AZURE_REDIRECT_URI'),
  'tenant' => env('AZURE_TENANT_ID'),
  'proxy' => env('PROXY')  // optionally
],

In addition, you need to add this provider's event listener to your app/Providers/EventServiceProvider.php file:

protected $listen = [
    // ... other listeners
    \SocialiteProviders\Manager\SocialiteWasCalled::class => [
        // ... other providers
        \SocialiteProviders\Azure\AzureExtendSocialite::class.'@handle',
    ],
];

Finally, don't forget to add the needed environment variables to your .env file:

AZURE_CLIENT_ID=
AZURE_CLIENT_SECRET=
AZURE_REDIRECT_URI=
AZURE_TENANT_ID=

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 4
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-04-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固