Bonjour,

je suis buté à probleme avec l'authentification avec mongodb dans le firewall et je ne sais pas comment je peux faire,
j'ai pris mon code que j'uiliser avec mysql et j'ai changer App\Entity\User par App\Document\User et ca ne fonctionne plus.

on m'affiche le message suivant
My Error says: The class 'App\Document\User' was not found in the chain configured namespaces App\Entity with code: 0around
Please Help

security:
encoders:
App\Document\User:
algorithm: bcrypt
cost: 12

role_hierarchy:
    ROLE_ADMIN:       ROLE_USER
    ROLE_SUPER_ADMIN: [ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]

# https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
providers:
    # used to reload user from session & other features (e.g. switch_user)
    app_user_provider:
        entity:
            class: App\Document\User
            property: email
firewalls:
    dev:
        pattern: ^/(_(profiler|wdt)|css|images|js)/
        security: false
    main:
        anonymous: true
        guard:
            authenticators:
                - App\Security\LoginFormAuthenticator
                - App\Security\AppAddAuthenticator
            entry_point: App\Security\AppAddAuthenticator

        logout:
            path: app_logout

        remember_me:
                secret:   '%kernel.secret%'
                lifetime: 604800 # 1 week in seconds
                path:     /
                # by default, the feature is enabled by checking a
                # checkbox in the login form (see below), uncomment the
                # following line to always enable it.
                always_remember_me: true

        # activate different ways to authenticate

        # http_basic: true
        # https://symfony.com/doc/current/security.html#a-configuring-how-your-users-will-authenticate

        # form_login: true
        # https://symfony.com/doc/current/security/form_login_setup.html

# Easy way to control access for large sections of your site
# Note: Only the *first* access control that matches will be used
access_control:
    # - { path: ^/admin, roles: ROLE_ADMIN }
    # - { path: ^/profile, roles: ROLE_USER }

    # matches /admin/users/*
    - { path: ^/admin/users, roles: ROLE_SUPER_ADMIN }

    # matches /admin/* except for anything matching the above rule
    - { path: ^/admin, roles: ROLE_ADMIN }

Aucune réponse