mirror of
https://github.com/symfony/recipes-contrib.git
synced 2026-09-12 07:36:34 +03:00
157 lines
8.0 KiB
JSON
157 lines
8.0 KiB
JSON
{
|
|
"manifests": {
|
|
"pasaia-udala/auth-bundle": {
|
|
"manifest": {
|
|
"bundles": {
|
|
"PasaiaUdala\\AuthBundle\\PasaiakoUdalaAuthBundle": [
|
|
"all"
|
|
]
|
|
},
|
|
"copy-from-recipe": {
|
|
"config/": "%CONFIG_DIR%/"
|
|
},
|
|
"env": {
|
|
"LDAP_HOST": "ldap.example.com",
|
|
"LDAP_PORT": "389",
|
|
"LDAP_BASE_DN": "dc=example,dc=com",
|
|
"LDAP_USER_DN_PATTERN": "uid={username},ou=users,dc=example,dc=com",
|
|
"LDAP_BIND_DN": "",
|
|
"LDAP_BIND_PASSWORD": ""
|
|
},
|
|
"post-install-output": [
|
|
"# PasaiakoUdalaAuthBundle - Post-install message",
|
|
"",
|
|
"## Configuration completed",
|
|
"",
|
|
"The **PasaiakoUdalaAuthBundle** has been installed successfully.",
|
|
"",
|
|
"### Next steps",
|
|
"",
|
|
"1. **Configure environment variables** in your `.env` file:",
|
|
" - Update values for `LDAP_HOST`, `LDAP_BASE_DN`, `LDAP_USER_DN_PATTERN`, etc.",
|
|
" - Set `LDAP_BIND_DN` and `LDAP_BIND_PASSWORD` if your LDAP server requires a service account for searches.",
|
|
"",
|
|
"2. **Review the configuration** in `config/packages/pasaiako_udala_auth.yaml`:",
|
|
" - Adjust LDAP-to-Symfony role mapping under the `role_mapping` section.",
|
|
" - Verify the LDAP server parameters match your infrastructure.",
|
|
"",
|
|
"3. **Configure Symfony Security** in `config/packages/security.yaml`.",
|
|
" ",
|
|
" Add this configuration to your `config/packages/security.yaml` file:",
|
|
"",
|
|
" ```yaml",
|
|
" security:",
|
|
" providers:",
|
|
" ldap_user_provider:",
|
|
" id: PasaiaUdala\\AuthBundle\\Security\\LdapUserProvider",
|
|
"",
|
|
" firewalls:",
|
|
" main:",
|
|
" lazy: true",
|
|
" provider: ldap_user_provider",
|
|
" entry_point: PasaiaUdala\\AuthBundle\\Security\\LdapAuthenticator",
|
|
" ",
|
|
" custom_authenticators:",
|
|
" - PasaiaUdala\\AuthBundle\\Security\\LdapAuthenticator",
|
|
" - PasaiaUdala\\AuthBundle\\Security\\CertificateAuthenticator",
|
|
" ",
|
|
" logout:",
|
|
" path: app_logout",
|
|
" target: app_auth_selector",
|
|
"",
|
|
" access_control:",
|
|
" - { path: ^/login, roles: PUBLIC_ACCESS }",
|
|
" - { path: ^/oauth, roles: PUBLIC_ACCESS }",
|
|
" - { path: ^/auth-selector, roles: PUBLIC_ACCESS }",
|
|
" - { path: ^/, roles: ROLE_USER }",
|
|
" ```",
|
|
"",
|
|
" **IMPORTANT**: If you use multiple authenticators, define the `entry_point`.",
|
|
"",
|
|
"4. **Create controllers** if they do not exist:",
|
|
" - `SecurityController` to handle LDAP login and the auth selector.",
|
|
" - `OAuth2Controller` if you use certificate-based (Izenpe) authentication.",
|
|
" - See the bundle documentation at `vendor/pasaia-udala/auth-bundle/docs/INSTALLATION.md` for details.",
|
|
"",
|
|
"5. **Verify the installation**:",
|
|
" ```bash",
|
|
" php bin/console debug:container | grep -i ldap",
|
|
" php bin/console debug:config pasaiako_udala_auth",
|
|
" ```",
|
|
"",
|
|
"### Additional documentation",
|
|
"",
|
|
"- Full installation guide: `vendor/pasaia-udala/auth-bundle/docs/INSTALLATION.md`",
|
|
"- Advanced LDAP configuration: `vendor/pasaia-udala/auth-bundle/docs/LDAP.md`",
|
|
"- Izenpe / OAuth2 configuration: `vendor/pasaia-udala/auth-bundle/docs/IZENPE.md`",
|
|
"- Customizing templates: `vendor/pasaia-udala/auth-bundle/docs/TEMPLATES.md`",
|
|
"- Troubleshooting: `vendor/pasaia-udala/auth-bundle/docs/TROUBLESHOOTING.md`",
|
|
"",
|
|
"Thank you!"
|
|
]
|
|
},
|
|
"files": {
|
|
"config/packages/pasaiako_udala_auth.yaml": {
|
|
"contents": [
|
|
"pasaiako_udala_auth:",
|
|
" server:",
|
|
" host: '%env(LDAP_HOST)%'",
|
|
" port: '%env(int:LDAP_PORT)%'",
|
|
" encryption: 'none'",
|
|
" base_dn: '%env(LDAP_BASE_DN)%'",
|
|
" user_dn_pattern: '%env(LDAP_USER_DN_PATTERN)%'",
|
|
" bind_dn: '%env(default::LDAP_BIND_DN)%'",
|
|
" bind_password: '%env(default::LDAP_BIND_PASSWORD)%'",
|
|
"",
|
|
" role_mapping:",
|
|
" # Mapea tus grupos LDAP a roles de Symfony",
|
|
" # Ejemplo:",
|
|
" # informatika: ROLE_ADMIN",
|
|
" # langilea: ROLE_USER",
|
|
"",
|
|
" default_role: ROLE_USER",
|
|
"",
|
|
" group_search:",
|
|
" enabled: true",
|
|
" base_dn: null",
|
|
" filter: '(member={user_dn})'",
|
|
" recursive: true",
|
|
""
|
|
],
|
|
"executable": false
|
|
},
|
|
"config/routes/pasaiako_udala_auth.yaml": {
|
|
"contents": [
|
|
"# Rutas del bundle de autenticaci\u00f3n (ejemplo - personalizar seg\u00fan necesidad)",
|
|
"# Descomentar y adaptar seg\u00fan tu aplicaci\u00f3n",
|
|
"",
|
|
"# app_auth_selector:",
|
|
"# path: /auth-selector",
|
|
"# controller: App\\Controller\\SecurityController::authSelector",
|
|
"",
|
|
"# app_login_ldap:",
|
|
"# path: /login/ldap",
|
|
"# controller: App\\Controller\\SecurityController::loginLdap",
|
|
"",
|
|
"# app_logout:",
|
|
"# path: /logout",
|
|
"# methods: GET",
|
|
"",
|
|
"# OAuth2 routes (si usas autenticaci\u00f3n por certificado)",
|
|
"# app_oauth_connect:",
|
|
"# path: /oauth/connect",
|
|
"# controller: App\\Controller\\OAuth2Controller::connect",
|
|
"",
|
|
"# app_oauth_check:",
|
|
"# path: /oauth/check",
|
|
"# controller: App\\Controller\\OAuth2Controller::check",
|
|
""
|
|
],
|
|
"executable": false
|
|
}
|
|
},
|
|
"ref": "b819605c305948ab1b94c391b99d8d557d90814b"
|
|
}
|
|
}
|
|
}
|