fittinq/symfony-authenticator

There is no license information available for the latest version (13.0.0) of this package.

13.0.0 2024-03-08 15:48 UTC

README

Shield of your service with the authenticator library

Install via composer

composer require fittinq\symfony-authenticator

Configure bundle

# config/bundles.php
<?php

return [
    // ...
    Fittinq\Symfony\Authenticator\SymfonyAuthenticatorBundle::class => ['all' => true],
];

.env

Configure the following .env.local settings

AUTHENTICATOR_HOST_URL=dev.auth.hip.fittinq.com
AUTHENTICATOR_KEY_PUB=/var/www/app/auth.key.pub

Setup security.yaml

security:
  enable_authenticator_manager: true

  providers:
    user_provider:
      id: Fittinq\Symfony\Authenticator\Authenticator\JwtUserProvider

  firewalls:
    unsecure:
      pattern: ^/(health|authenticator-callback)
      security: false
    secure:
      provider: user_provider
      custom_authenticators:
#        Depending on your problem, you can add either authenticator.
#        - Fittinq\Symfony\Authenticator\Authenticator\CookieAuthenticator
#        - Fittinq\Symfony\Authenticator\Authenticator\HeaderAuthenticator
          
  access_control:
    - {path: '^/users', roles: ROLE_ADMIN_AUTHENTICATOR}