micayael / autheticator-client-bundle
Cliente para Authenticator
Installs: 113
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:symfony-bundle
pkg:composer/micayael/autheticator-client-bundle
Requires
- csa/guzzle-bundle: ^2.0
- lcobucci/jwt: ^3.2
- sensio/framework-extra-bundle: ^3.0.2
- symfony/symfony: 3.3.*
This package is auto-updated.
Last update: 2025-10-29 02:22:38 UTC
README
Instalación del bundle
Agregar al composer.json
    "require": {
        ...
        "micayael/autheticator-client-bundle": "^1.0.0"
    },
Activación del bundle en el AppKernel.php
        $bundles = [
            ...
            new Csa\Bundle\GuzzleBundle\CsaGuzzleBundle(),
            new Micayael\Authenticator\ClientBundle\AuthenticatorClientBundle(),
            ...
        ];
Configuración del guzzle para consultar el servicio del authenticator
csa_guzzle:
    profiler: '%kernel.debug%'
    logger: true
    clients:
        authenticator:
            config:
                base_uri: http://localhost:8001
                headers:
                    "Content-Type": application/json
Configuración del bundle
Para ver la documentación de las configuraciones: bin/console config:dump-reference authenticator_client
authenticator_client:
    host: http://IP:PORT
    token_uri: /api/jwt/token # opcional
    default_target_route: admin # opcional, default: admin
    change_password_url: http://authenticator_url/admin/resetting/request
    type: basic_auth
    basic_auth:
        username: app1
        password: app1
o
authenticator_client:
    host: http://IP:PORT
    change_password_url: http://authenticator_url/admin/resetting/request
    type: app_id
    app_id: app2_id_test
Publicación de assets
bin/console assets:install --relative --symlink
Importación de rutas en el archivo routing.yml
authenticator:
    resource: "@AuthenticatorClientBundle/Resources/config/routing.yml"
    prefix: /
Configuración del security
    providers:
        authenticator:
            id: 'authenticator_client.authenticator_user_provider'
    encoders:
        AppBundle\Security\User\AuthenticatorUser: plaintext
    firewalls:
        main:
            anonymous: ~
            logout:
                path: /logout
            guard:
                authenticators:
                    - 'authenticator_client.login_form_authenticator'
    access_control:
        - { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/admin, roles: ROLE_USER }
Documentación Extra
- Para definir tiempo de vida y nombre de la sesión: https://symfony.com/doc/current/reference/configuration/framework.html#session
- En caso de que ocurra un error se puede apuntar en la configuración del csa_guzzle al entorno de desarrollo del authenticator base_uri: http://localhost:8001/app_dev.php y para ver los datos se puede cambiar la configuración dentro del config_dev.yml de la aplicación cliente para que intercepte las redirecciones intercept_redirects: true