定制 sunxyw/spiral-auth0-bridge 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

sunxyw/spiral-auth0-bridge

最新稳定版本:v0.6.0

Composer 安装命令:

composer require sunxyw/spiral-auth0-bridge

包简介

This is my package spiral-auth0-bridge

README 文档

README

PHP Version Require Latest Stable Version phpunit psalm Codecov Total Downloads

This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.

Requirements

Make sure that your server is configured with following PHP version and extensions:

  • PHP 8.1+
  • Spiral framework 3.0+

Installation

You can install the package via composer:

composer require sunxyw/spiral-auth0-bridge

After package install you need to register bootloader from the package.

protected const LOAD = [
    // ...
    \Sunxyw\SpiralAuth0Bridge\Bootloader\Auth0BridgeBootloader::class,
];

Note: if you are using spiral-packages/discoverer, you don't need to register bootloader by yourself.

Usage

Register the \Sunxyw\SpiralAuth0Bridge\Security\Auth0TokenStorage token storage via config or bootloader, you may find documentation here.

Then, register the actor provider \Sunxyw\SpiralAuth0Bridge\Security\Auth0ActorProvider via bootloader too, documentation may find here.

You may want to scroll down the documentation page to find the registration steps.

Please remember to configure your AuthTransportMiddleware too, otherwise, Auth0 bridge will not able to retrieve the token. Docs.

After that, you can obtain the actor using AuthContextInterface.

public function index(\Spiral\Auth\AuthContextInterface $auth)
{
    if ($auth->getActor() === null) {
        throw new ForbiddenException();
    }

    dump($auth->getActor());
}

The actor will be an instance of \Sunxyw\SpiralAuth0Bridge\Security\Auth0Actor.

Testing

composer test

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.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-08-05