Maks3w / FR3DLdapBundle

This bundle integrates LDAP Authentication with any user manager (Ex: FOSUserBundle)
119 stars 77 forks source link

Trying to use the bundle without the fosuserbundle #117

Closed cirovargas closed 8 years ago

cirovargas commented 8 years ago

Im trying but got this error:

'You cannot refresh a user from the EntityUserProvider that does not contain an identifier. The user object has to be serialized with its own identifier mapped by Doctrine. '

I've copyed the fosusermanager, fix references and implemented the Fr3d UserManagerInterface.

the user are not persisted on the db.

security:
    encoders:
        MyBundle\Entity\CoreUser:
            algorithm: bcrypt
            cost: 12
    providers:
        chain_provider:
            chain:
                providers: [db, fr3d_ldapbundle]
        fr3d_ldapbundle:
            id: fr3d_ldap.security.user.provider
        db:
            entity:
                class: MyBundle:CoreUser
                property: usuario

    role_hierarchy:
        ROLE_ADMIN:       ROLE_USER
        ROLE_SUPER_ADMIN: ROLE_ADMIN

firewalls:
    dev:
        pattern: ^/(_(profiler|wdt|error)|css|images|js)/
        security: false
    default:
        pattern: ^/
        fr3d_ldap:  ~
        form_login:
            provider: db
            csrf_provider: security.csrf.token_manager
            login_path: /login
            check_path: /login_check
        logout:       true
        anonymous:    true
        switch_user: true
        remember_me:
            lifetime: 432000
            key: 111111111

access_control:
    - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
    - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
    - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
    - { path: ^/admin/, role: ROLE_USER }
Maks3w commented 8 years ago

That error is not produced by this bundle. This bundle does not persist the entity in any way.