The LexikJWTAuthenticationBundle provides authentication via Json Web Token for Symfony2+ REST API .
Questions tagged [lexikjwtauthbundle]
221 questions
2
votes
1 answer
How in Symfony get user in EventSubscriber using LexicJWT
I'm new to Symfony. I use LexicJWT token.
final class ProductCreateSubscriber implements EventSubscriberInterface
{
private $entityManager;
private $hostRepository;
public function __construct(EntityManagerInterface $entityManager,…

Billizzard
- 472
- 6
- 15
2
votes
0 answers
Symfony 4 Rest API Token Verification calling start method default
https://symfony.com/doc/current/security/guard_authentication.html
According to the documentation, the start function would be called if the client accesses a URI/resource that requires authentication, but no authentication details were sent but I…

PANKAJ NAROLA
- 164
- 1
- 10
2
votes
0 answers
When to use Open Id Connect?
I'm building an app (front : ionic, php/symfony for backend) where I use jwt token to give access to backend, with LexikJWTAuthenticationBundle.
I was following an ionic tutorial to build a simple login form…

ramsey_lewis
- 558
- 8
- 25
2
votes
1 answer
Jwt authentication bundle, how to authorization user after registration
Symfony 3.3.10, lexik/jwt-authentication-bundle": "~2.0"
I have endpoint for registration /api/registrations where I create user and set it to DB and return json with object user. And I have endpoint for authentication /api/login_check where JWT…

shuba.ivan
- 3,824
- 8
- 49
- 121
2
votes
2 answers
Why my jwt tokens never expire?
I've inherited a Symfony project that uses this controller to authenticate users:
class TokenController extends FOSRestController
{
public function postTokensAction(Request $request)
{
$username = $request->request->get('username');
…

sensorario
- 20,262
- 30
- 97
- 159
2
votes
0 answers
Symfony JWT Bundle and form authentication
When configuring the LexikJWTAuthenticationBundle I just need to set up the security.yml with these settings:
security:
# ...
firewalls:
login:
pattern: ^/api/login
stateless: true
anonymous:…

StockBreak
- 2,857
- 1
- 35
- 61
2
votes
1 answer
Can't test API endpoint with JWT token in Symfony
I'm having some troubles when testing my endpoint with Phpunit and Symfony. The thing is I'm able to authenticate correctly when using nelmio api doc for making tests, with postman, or even from the client side which is in android.
But when I',…

Jotaeme
- 345
- 1
- 6
- 16
2
votes
2 answers
LexikJWT get user profile by token
Using LexikJWTAuthenticationBundle, FOSRest, FOSUser how do I get authenticated user profile by token. Is it possible?
So let's say user is already authenticated via LexikJWT and I have an api endpoint like /api/profile where I send the token and I…

fefe
- 8,755
- 27
- 104
- 180
2
votes
2 answers
Symfony3 JWT with LexikJWTAuthenticationBundle returns 404 on Preflight OPTIONS
Description:
I'm working with the LexikJWTAuthenticationBundle and trying to generate a JWT token with credentials sent from my Ionic2 App.
Generating the token works fine with Curl and with Postman.
curl -X POST…

kemicofa ghost
- 16,349
- 8
- 82
- 131
2
votes
1 answer
Event 'kernel.request' doesn't dispatch correctly
I'm trying tu use LexikJWTAuthBundle with FOSRestBundle to securize my API routes.
It works well when I manually give the JWT in the header of my requests, but for my app I would like to add it automatically in each API requests' header via the…

Maxime Picard
- 603
- 5
- 17
2
votes
1 answer
LexikJWTAuthenticationBundle generate Token
I am using the LexikJWTAuthenticationBundle to generate json token, my problem is that I don't know how I generate a token after verifying that the user is in BD. I am able to help?
My Code.
public function postLoginAction(Request $request)
{
…

user26776
- 131
- 3
- 12
2
votes
0 answers
Symfony LexikJWTAuthenticationBundle A Token was not found in the TokenStorage
I have LexikJWTAuthenticationBundle working on my Symfony project and locally it works great.
The issue I am having is in the remote server. If I do a post to the end point login_check with the correct username and password I get the token without…

AntonioCS
- 8,335
- 18
- 63
- 92
1
vote
1 answer
How I can send JWT Token in request header? (Symfony 6)
Im using JWT in my application with the lexikjwtauthbundle. I have created a service in API Platform and when I use the login service, I send the email and the password and it returns the token correctly among another user data.
My application has…

RookieCoder
- 35
- 4
1
vote
0 answers
LexikJWTAuthenticationBundle delete token and jwt token of an user by his id
is there any way to delete the token of an user only by his id or username in LexikJWTAuthenticationBundle
in Symfony 6 ?
expected to redirect the user to logout whilte his logged in

echalh adil
- 11
- 1
1
vote
0 answers
API Keys Symfony and JWT Authentication
My question is more about logical understanding than in my code itself (at the moment).
I created an API with Symfony and thanks to the tutorial on KahereCode.
I have now 2 possible clients, an application and a website.
I have some resources that…

Pax
- 153
- 1
- 11