|
1 |
| -Authentication through SSO CAS Server with Symfony2 |
2 |
| -=================================================== |
3 |
| - |
4 |
| -- use the Bundle : BeSimpleSsoAuthBundle (instal with Composer) |
5 |
| -- be careful on dependences : Buzz needs a recent version of libcurl (7.19 ??) |
6 |
| - |
7 |
| - |
8 |
| -Configure SSO |
9 |
| -------------- |
10 |
| - |
11 |
| -In config.yml: |
12 |
| - |
13 |
| - be_simple_sso_auth: |
14 |
| - admin_sso: |
15 |
| - protocol: |
16 |
| - id: cas |
17 |
| - version: 2 |
18 |
| - server: |
19 |
| - id: cas |
20 |
| - login_url: https://cas.server.tld/login |
21 |
| - logout_url: https://cas.server.tld/logout |
22 |
| - validation_url: https://cas.server.tld/serviceValidate |
23 |
| - |
24 |
| - |
25 |
| - |
26 |
| -Create a firewall |
27 |
| ------------------ |
28 |
| - |
29 |
| -In security.yml: |
30 |
| - |
31 |
| - my_firewall: |
32 |
| - pattern: ^/ |
33 |
| - anonymous: ~ |
34 |
| - trusted_sso: |
35 |
| - manager: admin_sso |
36 |
| - |
37 |
| - login_action: false # BeSimpleSsoAuthBundle:TrustedSso:login |
38 |
| - logout_action: false # BeSimpleSsoAuthBundle:TrustedSso:logout |
39 |
| - create_users: true |
40 |
| - created_users_roles: [ROLE_USER ] |
41 |
| - check_path: / |
42 |
| - |
43 |
| - |
44 |
| -Create all routes (mandatory even if there is no controller) |
45 |
| ------------------------------------------------------------- |
46 |
| - |
47 |
| -In routing.yml : |
48 |
| - |
49 |
| - login: |
50 |
| - pattern: /login |
51 |
| - |
52 |
| - logout: |
53 |
| - pattern: /logout |
54 |
| - |
55 |
| - |
56 |
| -Providers |
57 |
| ---------- |
58 |
| - |
59 |
| -Example with Propel: |
60 |
| - |
61 |
| - providers: |
62 |
| - administrators: |
63 |
| - propel: |
64 |
| - class: Altern\CdtBundle\Model\User |
65 |
| - property: username |
66 |
| - |
67 |
| -The propel User Class must implement \Symfony\Component\Security\Core\User\UserInterface |
68 |
| - |
69 |
| - |
70 |
| -If necessary, you can disable SSL Certificat Verification |
71 |
| ---------------------------------------------------------- |
72 |
| - |
73 |
| -Add in parameters.ini : |
74 |
| - |
75 |
| - be_simple.sso_auth.client.option.curlopt_ssl_verifypeer.value: FALSE |
| 1 | +Authentication through SSO CAS Server with Symfony2 |
| 2 | +=================================================== |
| 3 | + |
| 4 | +- use the Bundle : BeSimpleSsoAuthBundle (install with Composer) |
| 5 | +- be careful on dependences : Buzz needs a recent version of libcurl (7.19 ??) |
| 6 | + |
| 7 | + |
| 8 | +Configure SSO |
| 9 | +------------- |
| 10 | + |
| 11 | +In config.yml: |
| 12 | + |
| 13 | + be_simple_sso_auth: |
| 14 | + admin_sso: |
| 15 | + protocol: |
| 16 | + id: cas |
| 17 | + version: 2 |
| 18 | + server: |
| 19 | + id: cas |
| 20 | + login_url: https://cas.server.tld/login |
| 21 | + logout_url: https://cas.server.tld/logout |
| 22 | + validation_url: https://cas.server.tld/serviceValidate |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | +Create a firewall |
| 27 | +----------------- |
| 28 | + |
| 29 | + # app/config/security.yml |
| 30 | + my_firewall: |
| 31 | + pattern: ^/ |
| 32 | + anonymous: ~ |
| 33 | + trusted_sso: |
| 34 | + manager: admin_sso |
| 35 | + login_action: false # BeSimpleSsoAuthBundle:TrustedSso:login |
| 36 | + logout_action: false # BeSimpleSsoAuthBundle:TrustedSso:logout |
| 37 | + create_users: true |
| 38 | + created_users_roles: [ROLE_USER ] |
| 39 | + check_path: / |
| 40 | + |
| 41 | + |
| 42 | +Create all routes (mandatory even if there is no controller) |
| 43 | +------------------------------------------------------------ |
| 44 | + |
| 45 | + # app/config/routing.yml |
| 46 | + login: |
| 47 | + pattern: /login |
| 48 | + logout: |
| 49 | + pattern: /logout |
| 50 | + |
| 51 | + |
| 52 | +Providers |
| 53 | +--------- |
| 54 | + |
| 55 | +Example with Propel: |
| 56 | + |
| 57 | + providers: |
| 58 | + administrators: |
| 59 | + propel: |
| 60 | + class: Altern\CdtBundle\Model\User |
| 61 | + property: username |
| 62 | + |
| 63 | +The propel User Class must implement \Symfony\Component\Security\Core\User\UserInterface |
| 64 | + |
| 65 | +Customize the "Username does not exist" error page |
| 66 | +-------------------------------------------------- |
| 67 | + |
| 68 | +When a user successfully authenticates, but is not in the user provider's data store (or a user provider is not configured at all), |
| 69 | +then a generic error page is shown indicating that the user was not found. You can customize this error page by overriding the Twig error template, |
| 70 | +as described here: http://symfony.com/doc/current/cookbook/controller/error_pages.html |
| 71 | + |
| 72 | +If necessary, you can disable SSL Certificate Verification |
| 73 | +---------------------------------------------------------- |
| 74 | + |
| 75 | +This is handy when using a development server that does not have a valid certificate, but it should not be done in production. |
| 76 | + |
| 77 | + # app/config/parameters.yml |
| 78 | + be_simple.sso_auth.client.option.curlopt_ssl_verifypeer.value: FALSE |
0 commit comments