update config of security.yml

This commit is contained in:
ELMAKHROUBI ABDELLAH
2021-11-10 16:46:26 +01:00
parent 436615212d
commit 9e2b3efc80

View File

@@ -59,6 +59,7 @@ Here is a simple configuration that restrict access to ```/api/*``` routes only
```yaml ```yaml
# config/packages/security.yaml # config/packages/security.yaml
security: security:
enable_authenticator_manager: true
providers: providers:
keycloak_bearer_user_provider: keycloak_bearer_user_provider:
id: ABEL\Bundle\keycloakBearerOnlyAdapterBundle\Security\User\KeycloakBearerUserProvider id: ABEL\Bundle\keycloakBearerOnlyAdapterBundle\Security\User\KeycloakBearerUserProvider
@@ -68,13 +69,10 @@ security:
security: false security: false
api: api:
pattern: ^/api/ pattern: ^/api/
guard:
provider: keycloak_bearer_user_provider provider: keycloak_bearer_user_provider
authenticators: custom_authenticators:
- ABEL\Bundle\keycloakBearerOnlyAdapterBundle\Security\Authenticator\KeycloakBearerAuthenticator - ABEL\Bundle\keycloakBearerOnlyAdapterBundle\Security\Authenticator\KeycloakBearerAuthenticator
stateless: true stateless: true
main:
anonymous: ~
access_control: access_control:
- { path: ^/api/, roles: ROLE_API } - { path: ^/api/, roles: ROLE_API }
``` ```