neznajki/json-rpc-authorization

authorization for json rpc

v0.1.7 2020-07-24 09:01 UTC

This package is auto-updated.

Last update: 2024-11-24 18:43:28 UTC


README

makes authorization for json rpc

bundle installation

  • composer require neznajki/json-rpc-authorization
  • services.yaml
imports:
    - { resource: '@JsonRpcAuthBundle/Resources/config/services.yaml' }
  • security.yaml
    providers:
        #...
        jsonRpcProvider:
            id: JsonRpcAuthorizationBundle\Service\DefaultUserProviderService

    firewalls:
        #...
        jsonRpc:
            pattern: ^/jsonRpc
            provider: jsonRpcProvider
            guard:
                authenticators:
                    - JsonRpcAuthorizationBundle\Service\AuthenticationService

    access_control:
        #...
        - { path: '^/jsonRpc', roles: ROLE_RPC_USER}
  • parameters.yaml
pareameters:
    server.json.rpc.user.name: authorization
    server.json.rpc.user.password: qwerty