定制 paysera/lib-bearer-authentication-bundle 二次开发

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

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

paysera/lib-bearer-authentication-bundle

Composer 安装命令:

composer require paysera/lib-bearer-authentication-bundle

包简介

Bearer Authentication Bundle

README 文档

README

Install

Add bundle to AppKernel.php:

$bundles = [
    ...
    new Paysera\BearerAuthenticationBundle\PayseraBearerAuthenticationBundle(),
];

Samples

Sample security.yml for symfony 3/4

security:
    providers:
        bearer_user:
            id: paysera_bearer_authentication.security_user.bearer_user_provider
    
    firewalls:
        bearer_secured:
            pattern: ^/api/
            stateless: true
            bearer: true
            provider: bearer_user

Sample security.yml for Symfony 5

security:
    enable_authenticator_manager: true
    providers:
      bearer_user:
            id: paysera_bearer_authentication.security_user.bearer_user_provider    

    firewalls:
      bearer_secured:
            pattern: ^/api
            stateless: true
            provider: bearer_user
            custom_authenticators:
              - Paysera\BearerAuthenticationBundle\Security\BearerPassportAuthenticator
            
    access_control:
        # require ROLE_ADMIN for /admin*
        - { path: '^/api', roles: ROLE_ADMIN }

All bearer handlers must be tagged with:

<tag name="paysera_bearer_authentication.handler" />

and implement \Paysera\BearerAuthenticationBundle\Security\User\HandlerInterface

Example of a handler services.yaml

    paysera_auth_token.security.auth_token_handler:
        class: 'App\Services\BearerHandler'
        tags:
            - { name: 'paysera_bearer_authentication.handler' }

Support matrix

The below table shows the supported PHP versions for this library, please review the composer.json file for each individual package for additional requirements.

Package version Symfony Version PHP Version
0.x 2.x 5.5
0.x 3.x 5.5
1.0.0 3.x 5.5
1.0.1 3.x 5.5
1.0.1 4.x 5.5
2.x 4.x 7.4
2.x 5.x 7.4

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 7
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2018-02-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固