2017 © Pedro Peláez
 

library lib-bearer-authentication-bundle

Bearer Authentication Bundle

image

paysera/lib-bearer-authentication-bundle

Bearer Authentication Bundle

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 129 % Grown

The README.md

Bearer Authentication Bundle

Install

Add bundle to AppKernel.php:, (*1)

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

Samples

Sample security.yml for symfony 3/4, (*2)

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, (*3)

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:, (*4)

<tag name="paysera_bearer_authentication.handler" />

and implement \Paysera\BearerAuthenticationBundle\Security\User\HandlerInterface, (*5)

Example of a handler services.yaml, (*6)

    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., (*7)

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

The Versions

21/06 2018

dev-master

9999999-dev

Bearer Authentication Bundle

  Sources   Download

The Requires

 

21/06 2018

1.0.0

1.0.0.0

Bearer Authentication Bundle

  Sources   Download

The Requires

 

01/03 2018

0.0.3

0.0.3.0

Bearer Authentication Bundle

  Sources   Download

The Requires

 

27/02 2018

0.0.2

0.0.2.0

Bearer Authentication Bundle

  Sources   Download

The Requires

 

27/02 2018

0.0.1

0.0.1.0

Bearer Authentication Bundle

  Sources   Download

The Requires