Skip to content

Instantly share code, notes, and snippets.

@blafasel42
Created July 6, 2020 19:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blafasel42/8341d4b00905537b960a5dc36ed18b43 to your computer and use it in GitHub Desktop.
Save blafasel42/8341d4b00905537b960a5dc36ed18b43 to your computer and use it in GitHub Desktop.
security:
# https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
providers:
...
firewalls:
# This firewall is used to handle the actual login and is used as an endpoint for SSO-Proxy.
authentication:
pattern: ^/(auth|login|logout)
anonymous: ~
logout:
path: app_logout
target: app_login
# where to redirect after logout
# target: app_any_route
provider: database
guard:
authenticators:
- App\Authentication\Login\LoginFormAuthenticator
# IMPORTANT: auth has to be here, otherwise no user will be available
access_control:
- { path: ^/login/, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/auth/.*, roles: IS_AUTHENTICATED_REMEMBERED }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment