php - Lexik JWT Token not found -
i've seen similar questions still can't work.
i'm new symfony , i'm using lexik jwt bundle symfony3 api authentication, , login form web authentication.
i token ok when try use 401 - bad authentication. i've read can apache problem i'm trying php's built-in web server, still no luck.
here's security.yml file:
security: encoders: appbundle\entity\user: algorithm: bcrypt # http://symfony.com/doc/current/book/security.html#where-do-users-come-from-user-providers providers: in_memory: memory: ~ our_db_provider: entity: class: appbundle:user property: username firewalls: # disables authentication assets , profiler, adapt according needs dev: pattern: ^/(_(profiler|wdt)|css|images|js)/ security: false login: pattern: ^/api/login stateless: true anonymous: true form_login: check_path: /api/login_check success_handler: lexik_jwt_authentication.handler.authentication_success failure_handler: lexik_jwt_authentication.handler.authentication_failure require_previous_session: false provider: our_db_provider api: pattern: ^/api stateless: true provider: our_db_provider lexik_jwt: authorization_header: # check token in authorization header enabled: true prefix: bearer throw_exceptions: true # when authentication failure occurs, return 401 response create_entry_point: true # when no authentication details provided, create default entry point returns 401 response main: anonymous: ~ form_login: login_path: /login check_path: /login_check provider: our_db_provider access_control: - { path: ^/api/login, roles: is_authenticated_anonymously } - { path: ^/api, roles: is_authenticated_fully } - { path: ^/login, roles: is_authenticated_anonymously } - { path: ^/register, roles: is_authenticated_anonymously } - { path: ^/, roles: [role_admin, role_user] }
if set create_entry_point false in api firewall, 500 error: token not found in tokenstorage.
maybe i'm passing token wrong way? i've tried several ways i'm not sure 1 correct. here headers:
post /api/notifications http/1.1 host: localhost:8000 authorization: bearer {"token":"eyjhbgcioijsuzi1niisinr5cci6ikpxuyj9.eyjlehaioje0ntuwmdk1odasinvzzxjuyw1lijoiyxnvcmlhiiwiawf0ijoimtq1ndkymze4mcj9.rwgaklbestyozn3b96jlsf9_3qy-rjrrt2l5uxdxd8zadj2ybk-9m7qnqud9-bhaa_mfl1lsspz-0azmqczx8bl8xd_l2_df0wfvm6le6pejejk0arbyxleoz-9lrrdoa6ejnzdczt6wn76qnoscsjme7rjk0w0lls4exaaxgayl6lqu4yoim1xnifzhggtjkc7rbbivy8yhjfs51s6gwekzpgrymutzwmjhxfplkzcqejlaj6nt82a3puoiscmuvt7auxhhdgeus-tmjdty-whqal7f7z2fp0_fstkvorhdzc1vf7vlylf76snf0sh2tmtuvf70zynd_gf0k7b9zoop54e0mjt0xaltyctompsedhfjv1wjy6ezsrvdurrhxxtxha6k70fim_nqjpvo4raht-hqwmonwb3ib0svvytqhp96klxvgkhyiaicejvwhmonzgsrndme4hgxlpwmbkh6tvjpvwatoeawd4jjs-zld_5obr_o3vnpw81ozj0hui6ogzyvxdplpw3p7ma4lmbdqolwpuepg3lnukidu27umftrn3t-cfrb6kitu1btatl-aiom-f6fdlcgjfyxos6gefolftjj5ksaeiy8dwiubbrs-vh9uamlc9yaptlnvsui7whzo7qmxzc-v8idrnowbwvftymdla9yr_d7n9e"} cache-control: no-cache content-type: application/x-www-form-urlencoded
or
post /api/notifications http/1.1 host: localhost:8000 authorization: bearer {"eyjhbgcioijsuzi1niisinr5cci6ikpxuyj9.eyjlehaioje0ntuwmdk1odasinvzzxjuyw1lijoiyxnvcmlhiiwiawf0ijoimtq1ndkymze4mcj9.rwgaklbestyozn3b96jlsf9_3qy-rjrrt2l5uxdxd8zadj2ybk-9m7qnqud9-bhaa_mfl1lsspz-0azmqczx8bl8xd_l2_df0wfvm6le6pejejk0arbyxleoz-9lrrdoa6ejnzdczt6wn76qnoscsjme7rjk0w0lls4exaaxgayl6lqu4yoim1xnifzhggtjkc7rbbivy8yhjfs51s6gwekzpgrymutzwmjhxfplkzcqejlaj6nt82a3puoiscmuvt7auxhhdgeus-tmjdty-whqal7f7z2fp0_fstkvorhdzc1vf7vlylf76snf0sh2tmtuvf70zynd_gf0k7b9zoop54e0mjt0xaltyctompsedhfjv1wjy6ezsrvdurrhxxtxha6k70fim_nqjpvo4raht-hqwmonwb3ib0svvytqhp96klxvgkhyiaicejvwhmonzgsrndme4hgxlpwmbkh6tvjpvwatoeawd4jjs-zld_5obr_o3vnpw81ozj0hui6ogzyvxdplpw3p7ma4lmbdqolwpuepg3lnukidu27umftrn3t-cfrb6kitu1btatl-aiom-f6fdlcgjfyxos6gefolftjj5ksaeiy8dwiubbrs-vh9uamlc9yaptlnvsui7whzo7qmxzc-v8idrnowbwvftymdla9yr_d7n9e"} cache-control: no-cache content-type: application/x-www-form-urlencoded
any ideas?
thanks in advance!
the authorization header should be
authorization: bearer eyjhbgcioijsuzi1niisinr5cci6ikpxuyj9....9yr_d7n9e
Comments
Post a Comment