Skip to content

Instantly share code, notes, and snippets.

@chalasr
Created December 11, 2015 17:14
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 chalasr/8758170b31608e20e107 to your computer and use it in GitHub Desktop.
Save chalasr/8758170b31608e20e107 to your computer and use it in GitHub Desktop.
Lexik\JWTAuthenticationBundle configuration
security:
providers:
in_memory:
memory: ~
fos_userbundle:
id: fos_user.user_manager
encoders:
FOS\UserBundle\Model\UserInterface: sha512
acl:
connection: default
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
login:
pattern: ^/login
stateless: true
anonymous: true
form_login:
provider: fos_userbundle
check_path: /login_check
require_previous_session: false
username_parameter: username
password_parameter: password
success_handler: lexik_jwt_authentication.handler.authentication_success
failure_handler: lexik_jwt_authentication.handler.authentication_failure
api:
pattern: ^/api
stateless: true
lexik_jwt:
authorization_header:
enabled: true
prefix: Bearer # Header to be added in Angular requests (@max see Sandbox example)
query_parameter:
enabled: true
name: bearer
access_control:
# URL of FOSUserBundle which need to be available to anonymous users
- { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
# ...
# Your API
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment