diagvn/gluu-php-sdk

此软件包最新版本(1.3.10)没有提供许可证信息。

Gluu SDK

1.3.10 2023-01-10 10:10 UTC

This package is auto-updated.

Last update: 2023-09-10 11:47:58 UTC


README

目录
  1. 关于项目
  2. 入门
  3. 使用
  4. 贡献
  5. 许可证
  6. 联系方式
  7. 赞助商

关于项目

此库提供了一些连接到Gluu服务器的功能。

构建工具

Laravel

安装

composer require diagvn/gluu-php-sdk

php artisan vendor:publish Gluu\Providers\GluuServiceProvider --config

使用

认证

    public function authenticate(
        ?string $username,
        //Password can be null, if password = null, default password = config('gluu.default_password')
        ?string $password, 
        string $grantType,
        ?string $scope = null
    ) : ?array

注册用户

    public function register(
        string $username, 
        //Email can be null, if email = null, default email phoneNumber@gluu.diag.vn
        ?string $email,
        string $phoneNumber, 
        //Password can be null, if password = null, default password = config('gluu.default_password')
        ?string $password): mixed

示例

use Gluu\App\AuthenticationInterface;

class AuthController extends Controller
{
    public function __construct(
        private AuthenticationInterface $authenticationService,
    ) {
    }
    
    public function index(Request $request)
    {
        $this->authenticationService->register(
                username:$request->username,
                email: $request->email,
                phoneNumber: $request->phone_number,
                password: $request->password
            );
        $result = $this->authenticationService->authenticate(
                username: $request->username,
                password: $request->password,
                grantType: "password",
                scope: "openid"
            );
     return 
    }
}

贡献

  1. 分支项目
  2. 创建你的功能分支(git checkout -b feature/AmazingFeature
  3. 提交你的更改(git commit -m 'Add some AmazingFeature'
  4. 推送到分支(git push origin feature/AmazingFeature
  5. 打开一个拉取请求

许可证

根据MIT许可证分发。有关更多信息,请参阅LICENSE

联系方式

Bradley Nguyen - giang.nguyen@diag.vn

Travis Au - toan.au@diag.vn

Duc Bui - duc.bui@diag.vn

ricky-morty

赞助商

diag