hello-one/laravel-socialite-provider
Composer 安装命令:
composer require hello-one/laravel-socialite-provider
包简介
Use your hello one guest list as a Laravel Socialite Provider
README 文档
README
WORK IN PROGRESS - DO NOT USE IN PRODUCTION - WORK IN PROGRESS
Use your hello one guest list as a login provider for your Laravel App.
Installation
-
You can install this package via composer using the following command:
composer require hello-one/laravel-socialite-provider
The package will automatically register itself using package discovery.
-
Add your app as a OAuth Client on our dashboard.
As
Redirect Callback URLwe suggesthttps://{{yourLaravelApplication.com}}/hello-one/callbackAdd the Client ID and Client Secret to your
.envfileHELLO_ONE_SOCIALITE_CLIENT_ID={{ CLIENT_ID }} HELLO_ONE_SOCIALITE_CLIENT_SECRET={{ CLIENT_SECRET }} HELLO_ONE_SOCIALITE_CLIENT_REDIRECT={{ https://yourLaravelApplication.com/hello-one/callback }} HELLO_ONE_SOCIALITE_PROJECT_URL={{ https://your-hello-one-default-domain.com }}
Or publish the configuration
php artisan vendor:publish --tag 'hello-one-socialite'and edit
config/hello-one-socialite.phpaccordingly. -
Create your routes in
web.phpRoute::get( 'hello-one/login', [ \App\Http\Controllers\Controller::class, 'redirectToProvider' ]); Route::get( 'hello-one/callback', [ \App\Http\Controllers\Controller::class, 'handleProviderCallback' ]);
-
Create your controller methods
/** * Redirect the user to the hello one login/authorization page. * * @return \Symfony\Component\HttpFoundation\RedirectResponse */ public function redirectToProvider(\Illuminate\Http\Request $request) { return \Socialite::driver('hello-one-guest') ->stateless() ->scopes(['account:read']) ->redirect(); } /** * Obtain the user information from hello one. * * @return \Illuminate\Http\Response */ public function handleProviderCallback() { $user = \Socialite::driver('hello-one-guest') ->stateless() ->scopes(['account:read']) ->user(); echo 'Hi' . $user->email; }
-
Visit
https://{{yourLaravelApplication.com}}/hello-one/loginand you will be redirected to hello one to login/authorize.
Documentation
Please notice our OAuth Documentation
Contributing
Feel free to open a ticket, submit a Pull Request or ask our Support Team
hello-one/laravel-socialite-provider 适用场景与选型建议
hello-one/laravel-socialite-provider 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 135 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 05 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 hello-one/laravel-socialite-provider 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 hello-one/laravel-socialite-provider 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 135
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-05-18