Open modlew opened 11 years ago
Hi again I think I found where the problem may come from.
I added my CAS login and password in the security.yml under :
providers:
in_memory:
memory:
users:
And I don't have the "Too many redirections" problem anymore, it works perfectly.
Anyway, I would like my users to use an Entity instead of having to write their login and password in the security.yml, can someone explain me how to do so ?
Is it possible to have the bundle fill/create an User entity at login ?
Thank you in advance.
Can someone help me using this bundle please ? Thank you in advance.
You figured out that the reason why you were getting the "Too many redirections" issue was because you did not have a user provider specified.
To use an Entity you have to have an entity provider. You can create your own User provider, as documented here: http://symfony.com/doc/current/cookbook/security/custom_provider.html
Alternatively you can use an existing bundle with a user provider like FOSUserBundle: https://github.com/FriendsOfSymfony/FOSUserBundle
To use FOSUserBundle with BeSimpleSSOAuth you would add the former's user provider to the latter's firewall in your security.yml file, like so...
# app/config/security.yml
security:
encoders:
FOS\UserBundle\Model\UserInterface: sha512
providers:
fos_userbundle:
id: fos_user.user_provider.username
my_firewall:
pattern: ^/
trusted_sso:
manager: admin_sso
create_users: false
login_action: false
logout_action: false
login_path: /login
check_path: /login_check
provider: fos_userbundle
@modlew To answer your other question, this bundle is not capable of automatically creating a User entity on login as it does not fire an interactive login event and it also doesn't have a listener for an interactive login event. If this bundle did fire an interactive login event, you could create an interactive login listener in your own bundle that created or updated a user when they login.
@modlew It looks like I was incorrect about this bundle not being able to facilitate the creation of users when they successfully authenticate. It looks like it can authorize a user provider to create not found users if the provider implements the UserFactoryInterface. See: https://github.com/BeSimple/BeSimpleSsoAuthBundle/blob/master/Resources/doc/trusted.md
Hi everyone.
I just setup symfony and this bundle, I tried to configure it but it seems I am doing something wrong.
my security.yml contains :
my routing.yml contains :
and my config.yml contains :
So as defined in my security.yml, as soon as I try to browse my application, I am redirected to my cas login url, this is perfect. Anyway, when I login or when I am already logged, I have an error from my browser because of too many redirections :
Thank you in advance for any help you can provide me !