PHP code example of paysera / lib-bearer-authentication-bundle

1. Go to this page and download the library: Download paysera/lib-bearer-authentication-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

paysera / lib-bearer-authentication-bundle example snippets


$bundles = [
    ...
    new Paysera\BearerAuthenticationBundle\PayseraBearerAuthenticationBundle(),
];
yaml
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
yaml
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:
        # 
xml
<tag name="paysera_bearer_authentication.handler" />