- TenantAccessPolicy: Plattform-Host nur Plattform-/Reseller-Admins, Reseller-Host nur dessen Nutzer, Firmen-Host nur Firmen-Nutzer (+ zugehöriger Reseller-Admin); Plattform-Admin überall. - LoginSuccessHandler prüft vor JWT-Ausstellung → 403 bei falschem Host. - Login zeigt die 403-Hinweismeldung. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
58 lines
1.8 KiB
YAML
58 lines
1.8 KiB
YAML
security:
|
|
password_hashers:
|
|
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto'
|
|
|
|
providers:
|
|
app_user_provider:
|
|
entity:
|
|
class: App\Entity\Employee
|
|
property: loginEmail
|
|
|
|
firewalls:
|
|
dev:
|
|
pattern: ^/(_profiler|_wdt|assets|build)/
|
|
security: false
|
|
|
|
# Öffentlicher Login-Endpunkt: tauscht E-Mail/Passwort gegen ein JWT
|
|
login:
|
|
pattern: ^/api/login$
|
|
stateless: true
|
|
json_login:
|
|
check_path: /api/login
|
|
username_path: email
|
|
password_path: password
|
|
success_handler: App\Security\LoginSuccessHandler
|
|
failure_handler: lexik_jwt_authentication.handler.authentication_failure
|
|
|
|
# Geschützte API: JWT im Authorization-Header
|
|
api:
|
|
pattern: ^/api
|
|
stateless: true
|
|
provider: app_user_provider
|
|
jwt: ~
|
|
|
|
main:
|
|
lazy: true
|
|
provider: app_user_provider
|
|
|
|
access_control:
|
|
- { path: ^/api/login, roles: PUBLIC_ACCESS }
|
|
- { path: ^/api/docs, roles: PUBLIC_ACCESS }
|
|
- { path: ^/api/branding, roles: PUBLIC_ACCESS }
|
|
- { path: ^/api, roles: IS_AUTHENTICATED_FULLY }
|
|
|
|
role_hierarchy:
|
|
ROLE_PLATFORM_ADMIN: [ROLE_RESELLER_ADMIN, ROLE_COMPANY_ADMIN, ROLE_EMPLOYEE, ROLE_CONTACT]
|
|
ROLE_RESELLER_ADMIN: [ROLE_COMPANY_ADMIN, ROLE_EMPLOYEE, ROLE_CONTACT]
|
|
ROLE_COMPANY_ADMIN: [ROLE_EMPLOYEE, ROLE_CONTACT]
|
|
ROLE_EMPLOYEE: [ROLE_CONTACT]
|
|
|
|
when@test:
|
|
security:
|
|
password_hashers:
|
|
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface:
|
|
algorithm: auto
|
|
cost: 4
|
|
time_cost: 3
|
|
memory_cost: 10
|