Guest User

Untitled

a guest
Oct 23rd, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. security:
  2. encoders:
  3. AppSecurityUserWebserviceUser: bcrypt
  4.  
  5. role_hierarchy:
  6. ROLE_ADMIN: ROLE_USER
  7. ROLE_SUPER_ADMIN: ROLE_ADMIN
  8.  
  9. providers:
  10. webservice:
  11. id: AppSecurityUserWebserviceUserProvider
  12. jwt:
  13. lexik_jwt:
  14. class: AppSecurityUserWebserviceUser
  15.  
  16. firewalls:
  17. dev:
  18. pattern: ^/(_(profiler|wdt)|css|images|js)/
  19. security: false
  20.  
  21. login:
  22. pattern: ^/login
  23. stateless: true
  24. anonymous: true
  25. provider: webservice
  26. json_login:
  27. check_path: /login_check
  28. success_handler: lexik_jwt_authentication.handler.authentication_success
  29. failure_handler: lexik_jwt_authentication.handler.authentication_failure
  30.  
  31. client_list:
  32. pattern: ^/api/client/active
  33. stateless: true
  34. anonymous: true
  35.  
  36. secured_area:
  37. pattern: ^/api/
  38. provider: webservice
  39. stateless: true
  40. guard:
  41. authenticators:
  42. - lexik_jwt_authentication.jwt_token_authenticator
  43.  
  44. access_control:
  45. - { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
  46. - { path: ^/api, roles: IS_AUTHENTICATED_FULLY }
  47. - { path: ^/api/client/active, roles: IS_AUTHENTICATED_ANONYMOUSLY }
  48.  
  49. $ openssl genrsa -out config/jwt/private.pem -aes256 4096
  50. Enter pass phrase for config/jwt/private.pem:
  51. Verifying - Enter pass phrase for config/jwt/private.pem:
  52. $ openssl rsa -pubout -in config/jwt/private.pem -out config/jwt/public.pem
  53. Enter pass phrase for config/jwt/private.pem:
  54. writing RSA key
  55.  
  56. $ curl -X POST -H "Content-Type: application/json" http://localhost:8000/login_check -d '{"username":"Pete","password":"password"}'
  57. {"code":401,"message":"Bad credentials"}
  58.  
  59. openssl genpkey -algorithm RSA -out config/jwt/private.pem -pkeyopt rsa_keygen_bits:4096
  60. openssl rsa -pubout -in config/jwt/private.pem -out /config/jwt/public.pem
Add Comment
Please, Sign In to add comment