fof/passport
Composer 安装命令:
composer require fof/passport
包简介
The OAuth2 (and Laravel passport) compatible oauth extension
README 文档
README
The Laravel Passport compatible oauth extension.
Installation
composer require fof/passport:*
Updating from Flagrow
This extension replaces Flagrow Passport.
To upgrade from the old extension to the new one:
-
Backup your data!
-
Disable the Passport extension in the admin panel.
-
Run:
composer require fof/passport:*
Composer should let you know that flagrow/passport has been automatically removed.
-
Enable the new extension in the admin panel.
-
Your existing settings will be migrated to FoF Passport automatically.
-
You should be good to go! All URLs stay the same.
Configuration
In the extension settings, you have to fill the following data:
| Setting | Example | Description |
|---|---|---|
| OAuth authorization url | https://example.com/oauth/authorize |
<your laravel install>/oauth/authorize |
| OAuth token url | https://example.com/oauth/token |
<your laravel install>/oauth/token |
| Api URL providing user details when authenticated | https://example.com/api/user |
Default Laravel installs have an /api/user route, otherwise point to a route returning the current user data (protected by the passport driver) |
| OAuth application id | 1 |
The integer Client ID you've made in the Laravel app or via artisan passport:client |
| OAuth application secret | abcdefghijABCDEFGHIJabcdefghijABCDEFGHIJ |
The Client secret provided by Laravel once you created the OAuth client |
| OAuth scopes to request | Optional additional scopes to request during authorization, perhaps you want to protect the user url with a scope or add additional functionality | |
| Label for login button | Login with Example | Label to place on the login button |
| Icon for login button | far fa-id-card |
FontAwesome icon to place on the login button. List of available icons |
Hint: When creating the OAuth client in your Laravel app, don't forget to set the redirect value to <your flarum install>/auth/passport or you might encounter invalid_client errors.
Links
An extension by FriendsOfFlarum
fof/passport 适用场景与选型建议
fof/passport 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 14.31k 次下载、GitHub Stars 达 31, 最近一次更新时间为 2020 年 03 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「oauth」 「oauth2」 「passport」 「league」 「flarum」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 fof/passport 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 fof/passport 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 fof/passport 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
WeChat OAuth SDK
Ory-Hydra OAuth 2.0 Client Provider for The PHP League OAuth2-Client
Library for ORCID web services
A lightweight and powerful OAuth 2.0 authorization and resource server library with support for all the core specification grants. This library will allow you to secure your API with OAuth and allow your applications users to approve apps that want to access their data from your API.
A package to allow laravel/passport use with mongodb/laravel-mongodb
Multiauth and custom grants for laravel passport
统计信息
- 总下载量: 14.31k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 31
- 点击次数: 4
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-03-23