Lexik JWT Token not found

前端 未结 3 1289
别那么骄傲
别那么骄傲 2021-01-13 03:20

I\'ve seen similar questions but still can\'t get this to work.

I\'m new with Symfony and I\'m using Lexik JWT bundle with symfony3 for API authentication, and a log

3条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-13 03:46

    The first solution works to solve "401 - Bad authentication" error.

    But for Apache users that have the error "401 - JWT Token not found", the solution is to rewrite HTTP Authorization header of request, by placing following instructions on your virtualhost :

    RewriteEngine On
    RewriteCond %{HTTP:Authorization} ^(.*)
    RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
    

    You could find further readings about this issue on documentation, on this post and this one.

提交回复
热议问题