Description
I am doing a web project with symfony2 that involves a CAS server: http://www.jasig.org/cas unfortunately I cannot make it working. I have tried several configurations and anything of what I do is correct. This is the flux that I am expecting to do for any user that wants to be logged:
- A user wants to login in my system
- My system redirects somehow the users to the cas server login web page to login with user credentials.
- After a valid login, cas server login webpage redirects user back to my system.
- My system knows if the user is well logged or not based on protocol mechanisms.
Following your instructions from the rep, here are all my configurations:
For the config.yml
be_simple_sso_auth:
admin_sso:
protocol:
id: cas
version: 2
server:
id: cas
login_url: https://cas_server.fi/cas/login
validation_url: https://cas_server.fi/cas/serviceValidate
For the security.yml
security:
encoders:
Symfony\Component\Security\Core\User\User: plaintext
role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
providers:
in_memory:
memory:
users:
user: { password: userpass, roles: [ 'ROLE_USER' ] }
admin: { password: adminpass, roles: [ 'ROLE_ADMIN' ] }
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
my_firewall:
pattern: ^/
anonymous: ~
trusted_sso:
manager: admin_sso
login_action: false
create_users: true
created_users_roles: [ROLE_ADMIN]
check_path: /
The cas server provided me two .crt files that I have already installed in my Ubuntu 13.10. Or at least I what I think... however any of this previous configurations do not seem to want these certificates since I cannot specify where the bundle can find them. Anyway it does not work yet so this step maybe is irrelevant.
So, what happens now is the next:
- User access to / for first time
- My system redirect him to /login (as far as I understand it is the default direction...)
To manage this /login I have in routing.yml in my own bundle:
ss_web_login:
path: /login
defaults: { _controller: BeSimpleSsoAuthBundle:TrustedSso:login }
I have checked this controller and it looks like it draws an anchor to "somewhere" (I guess is the login form of my cas server.
Let's continue... as I said, the user is being redirected to /login but I get an error:
Controller "BeSimple\SsoAuthBundle\Controller\TrustedSsoController::loginAction()" requires that you provide a value for the "$manager" argument (because there is no default value or because there is a non optional argument after this one).
It happens because the BeSimpleSsoAuthBundle:TrustedSso:login expects different parameters:
public function loginAction(Manager $manager, Request $request, AuthenticationException $exception = null)
But nobody is passing these parameters that it expects. What should I do?
Please, if you have ANY other suggestion about make this working I will really appreciate.
Thank you so much.