I just started using lexik-jwt
! and the problem is that after running the cmd :curl -X POST http://localhost:8000/api/login_check -d _username=johndoe -d _password=test
i always get this response {"code":401,"message":"Bad credentials"}
Asked
Active
Viewed 2,536 times
0

Vin
- 10,517
- 10
- 58
- 71

Khaled Bouguerra
- 13
- 1
- 4
-
Do you have correctly configured an User provider ? If yes, a custom ? FOSUserBundle ? Please provide more informations. – chalasr Apr 06 '16 at 22:15
-
I follwed the documentation in https://github.com/lexik/LexikJWTAuthenticationBundle/blob/master/Resources/doc/index.md , untel i reached the part when i have to test the token creation ! the curl cmd always returns 401 bad cerdentials , Idon't whether to make any other customizations not mentioned in the official documentation like configuring a User provider or use FOSUserbundle to make it all work , thanks for helping. – Khaled Bouguerra Apr 06 '16 at 22:28
1 Answers
1
To create an authentication system, users must be loaded from somewhere. To achieve this in Symfony, you need to configure a user provider.
There is a LexikJWTAuthenticationBundleSandbox application that uses the built-in in-memory user provider.
Look at this one to have an idea of what you need.

chalasr
- 12,971
- 4
- 40
- 82
-
1For using it with the symfony built-in entity provider, see https://github.com/chalasr/lexik-jwt-authentication-sandbox – chalasr Aug 17 '16 at 10:37