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
If someone still having this problem especially after doing everything above, you can try something like this. Instead of using HTTP_AUTHORIZATION you can use a custom http header such as Php-Auth-Digest. Using HTTP_AUTHORIZATION can be tricky and could be removed from the request due to various different server settings (especially using shared server environments, cPanel and so on)
The config to accept custom http header in LexikJWT Bundle is this,
lexik_jwt_authentication:
# token extraction settings
token_extractors:
# look for a token as Authorization Header
authorization_header:
enabled: true
prefix: Bearer
name: Php-Auth-Digest
To find more about this visit this link - https://github.com/lexik/LexikJWTAuthenticationBundle/blob/master/Resources/doc/1-configuration-reference.md
Sending the header from your api app would look like this (this is an example from Angular 6)
request = request.clone({
setHeaders: {
"Php-Auth-Digest": `Bearer ${currentUser.token}`,
}
});
I hope this helps someone. Cheers.