Guest User

Untitled

a guest
Jan 6th, 2018
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. # config/packages/api_platform.yaml
  2. api_platform:
  3. swagger:
  4. api_keys:
  5. - { name: 'Authorization', type: 'header' }
  6. mapping:
  7. paths: ['%kernel.project_dir%/src/Entity']
  8.  
  9. # config/packages/security.yaml
  10. security:
  11. encoders:
  12. AppEntityUser:
  13. algorithm: bcrypt
  14.  
  15. providers:
  16. db_provider:
  17. entity:
  18. class: AppEntityUser
  19. property: username
  20. firewalls:
  21. login:
  22. pattern: ^/api/login
  23. stateless: true
  24. anonymous: true
  25. provider: db_provider
  26. form_login:
  27. check_path: /api/login_check
  28. username_parameter: _username
  29. password_parameter: _password
  30. success_handler: lexik_jwt_authentication.handler.authentication_success
  31. failure_handler: lexik_jwt_authentication.handler.authentication_failure
  32. require_previous_session: false
  33.  
  34. main:
  35. pattern: ^/api
  36. provider: db_provider
  37. stateless: true
  38. anonymous: true
  39. lexik_jwt: ~
  40.  
  41. dev:
  42. pattern: ^/(_(profiler|wdt)|css|images|js)/
  43. security: false
  44.  
  45.  
  46. access_control:
  47. - { path: ^/api/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
  48. - { path: ^/api, roles: IS_AUTHENTICATED_FULLY }
Add Comment
Please, Sign In to add comment