Skip to content

Instantly share code, notes, and snippets.

@vincentchalamon
Created March 4, 2022 15:46
Show Gist options
  • Save vincentchalamon/f29db1a9f7fbfd8a32e8f22c8c0a22f7 to your computer and use it in GitHub Desktop.
Save vincentchalamon/f29db1a9f7fbfd8a32e8f22c8c0a22f7 to your computer and use it in GitHub Desktop.
API Platform Keycloak Security
# config/packages/security.yaml
security:
enable_authenticator_manager: true
providers:
app_user_provider:
entity:
class: App\Entity\User
property: email
firewalls:
main:
pattern: ^/
oauth:
resource_owners:
keycloak: "/login/check"
login_path: /login
use_forward: false
failure_path: /login
oauth_user_provider:
service: hwi_oauth.user.provider
provider: hwi_oauth.user.provider
access_control:
- { path: ^/login, roles: PUBLIC_ACCESS }
- { path: ^/, roles: ROLE_USER } // force login
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment