Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Looping on login action with entity provider... #59

Open
matthieuPouille opened this issue Feb 14, 2014 · 2 comments
Open

Looping on login action with entity provider... #59

matthieuPouille opened this issue Feb 14, 2014 · 2 comments

Comments

@matthieuPouille
Copy link

Hi everyone.

I'm actualy working on a project using your bundle with Symfony 2.4. I configured my project as shown in exemple.md. Sadly, it works only with users defined in security.yml (in memory provider).

If i use an entity provider (users defined in database), or if the user doesn't exist, it creates an inifnite loop :
login -> cas login -> login_check -> login -> cas login -> ...

Am I doing something wrong ?

config.yml

# Sso Bundle
be_simple_sso_auth: 
    admin_sso:
        protocol:
            id: cas
            version: 2
        server:
            id: cas
            login_url: https://auth.XXX.fr/cas/login
            logout_url: https://auth.XXXfr/cas/logout
            validation_url: https://auth.XXX.fr/cas/serviceValidate

security.yml

encoders:
    MyApp\G2CBundle\Entity\HarpUtilisateur:
        algorithm:        sha1
        encode_as_base64: false
        iterations:       1

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

    providers:
        in_memory:
            memory:
                users:
                    login-test : { password: pwd-test , roles: ROLE_USER }
        in_database:
            entity: { class: MyAppG2CBundle:HarpUtilisateur, property: uid }
firewalls:
    my_firewall:
        pattern: ^/g2c/.*$
        provider : in_database # this cause an infinite loop, it works using in_memory
        trusted_sso:
            manager:             admin_sso
            login_path:          /g2c/login
            check_path:          /g2c/login_check
            default_target_path: /g2c/hello/toto  
            login_action:         false
            logout_action:       false
            create_users:        false
        logout:
            path:   /g2c/logout
            target: /

PS: I put some var_dump() in SsoAuthenticationProvider, the SsoToken is built properly, the user is provided (a MyApp\G2CBundle\Entity\HarpUtilisateur object).

Thank you in advance for any help you can provide me !

@ReservedDeveloper
Copy link

Did you ever figure out what was going on here? I seem to be encountering similar issues. Updated documentation would be help this bundle a great deal.

@matthieuPouille
Copy link
Author

Yeah ... in my case it was due to serialization of data on the class implementing UserInterface (in the serialization method, i forgot to specify data to serialize/unserialize). So after serialization, informations about the user were deleted. Does it help you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants