Skip to content
Permalink
Browse files

refactor: Security configuration

  • Loading branch information...
tarlepp committed May 30, 2019
1 parent 54dd380 commit ca436a86aa18638ef0cc83cd1be627f1f73990a8
Showing with 5 additions and 12 deletions.
  1. +5 −12 config/packages/security.yaml
@@ -1,25 +1,18 @@
security:
# http://symfony.com/doc/current/cookbook/security/named_encoders.html
encoders:
Symfony\Component\Security\Core\User\User:
algorithm: argon2i
App\Entity\User:
algorithm: argon2i
App\Security\SecurityUser:
algorithm: argon2i

# https://symfony.com/doc/current/book/security.html#where-do-users-come-from-user-providers
providers:
chain_provider:
chain:
providers: [user_provider, api_key_user_provider, security_user_provider]
providers: [security_user_provider, api_key_user_provider]
security_user_provider:
id: App\Security\SecurityUserFactory
id: App\Security\Provider\SecurityUserFactory
api_key_user_provider:
id: App\Security\ApiKeyUserProvider
user_provider:
entity:
class: App\Entity\User
id: App\Security\Provider\ApiKeyUserProvider

# https://symfony.com/doc/current/security.html#a-configuring-how-your-users-will-authenticate
firewalls:
@@ -31,7 +24,7 @@ security:
stateless: true
anonymous: true
json_login:
provider: user_provider
provider: security_user_provider
check_path: /auth/getToken
success_handler: lexik_jwt_authentication.handler.authentication_success
failure_handler: lexik_jwt_authentication.handler.authentication_failure
@@ -47,7 +40,7 @@ security:
provider: chain_provider
authenticator: App\Security\ApiKeyAuthenticator
guard:
provider: user_provider
provider: security_user_provider
authenticators:
- lexik_jwt_authentication.jwt_token_authenticator

0 comments on commit ca436a8

Please sign in to comment.
You can’t perform that action at this time.