Questions tagged [lexikjwtauthbundle]

The LexikJWTAuthenticationBundle provides authentication via Json Web Token for Symfony2+ REST API .

221 questions
5
votes
1 answer

JWT authentification with Symfony 2.7

I'm trying to use LexikJWTAuthenticationBundle with FOSUserBundle on my Symfony 2.7 application. Basically, the FOSUserBundle config works fine: I properly load my fixtures and if I try to login via the login form it succeeds. Getting the token from…
Théo
  • 655
  • 7
  • 17
4
votes
2 answers

Symfony 4 - Lexik/JwtAuthenticationBundle - Cannot change token_ttl default value

I try to change the value of the token_ttl limit into the lexik_jwt_authentication.yaml file, but no matter the value I set, the generated token always has a 3600 seconds TTL. I also set the parameters secret_key and public_key and they are…
jean553
  • 621
  • 10
  • 29
4
votes
1 answer

Symfony 4: Test DB for JWT and Behat

I am using API Platform 2.1 with Symfony 4 and I am using the LexikJWTAuthenticationBundle for authentication, and Behat for testing. I am unable to set things up properly. Here is my configuration so far: Feature: Books feature @createSchema…
xfscrypt
  • 16
  • 5
  • 28
  • 59
4
votes
2 answers

LexikJWTAuthenticationBundle: Get current user on server side

I am using Symfony 3.4 and LexikJWTAuthenticationBundle 2.4. Do you know how to retrieve the user that is accessing the API endpoint? Normally, I would call $user = $this->get('security.token_storage')->getToken()->getUser(); but that doesn't seem…
burki
  • 2,946
  • 6
  • 37
  • 51
4
votes
0 answers

getUser return null in controller

I have a problem on a project. I use symfony 2.8, sonata-admin, fosuserbundle, fosrestbundle and lexikjwtauthbundle. On this route /api/login_check I can easily generate a token with a existing fosuser. But the problem is when I want to getUser in…
3
votes
1 answer

Symfony JWT - Change the login way using symfony lexik JWT Authentication Bundle

In the Symfony Lexik JWT Authentication bundle, It is explained how to authenticate users using a table in the database. In my case, My users aren't in the database but are in another application that I can access via API calls. Also, to retrieve…
beta-developper
  • 1,689
  • 1
  • 13
  • 24
3
votes
1 answer

LexikJWTAuthenticationBundle with multiple providers

I 2 part of applications - first for admins (admin panel) and second API. For API I want to use another model to check credentials and that retrieve a token. I thought that it could be achieved by specified check_path route where I can verify the…
YuriiChmil
  • 441
  • 1
  • 5
  • 18
3
votes
2 answers

LexikJWTAuthenticationBundle - Unable to find the controller for path "/api/login_check". The route is wrongly configured

I use configuration like documentation. This is my security file: security: encoders: FOS\UserBundle\Model\UserInterface: sha512 role_hierarchy: ROLE_ADMIN: [ROLE_USER] providers: fos_userbundle: id:…
Persei
  • 509
  • 1
  • 5
  • 12
3
votes
1 answer

Service not recognized by Symfony

I have a concern with the following service in my project: app.security.guardAuthenticatorLoginPassword: class: AppBundle\Security\LoginPasswordAuthenticator arguments: ["@router"] app.jwt_token_authenticator: class:…
Lydia Ra
  • 155
  • 12
2
votes
1 answer

Unrecognized option "api_platform" under "lexik_jwt_authentication"

I am currently working on programming a website using Symfony version 6.2 and API Platform in addition to MongoDB in the database and a work environment on Docker. I am trying to add the feature of connecting through JWT…
sayou
  • 893
  • 8
  • 29
2
votes
1 answer

Symfony 5.4 with lexik/jwt-authentication-bundle - JWT token not signed resulting in JWTEncodeFailureException

I refactored a Symfony 3 project to Symfony 5.4. For some API endpoints to work I need jwt token auth to work which I try with lexik/jwt-authentication-bundle (2.16). My setup is as…
2
votes
0 answers

Lexik jwt bundle - login by username or email

I use lexik/LexikJWTAuthenticationBundle 2.14 for login in a symfony 5.4 API project I can login by username, or by email via config, but i can't have login by (username or email) Even using X-debug, I couldn't find what to custom to do that Does…
danybond
  • 21
  • 1
2
votes
0 answers

lexik/LexikJWTAuthenticationBundle does not work with symfony 5.2

I'm trying to install and configure lexik/LexikJWTAuthenticationBundle in symfony 5.2 project. When I applied the following documentation https://github.com/lexik/LexikJWTAuthenticationBundle/blob/master/Resources/doc/index.md#installation, it gave…
hamouda4291
  • 31
  • 1
  • 2
2
votes
1 answer

Adding authentication documentation to Swagger in NelmioApiDocBundle

I'm using Symfony (5) with NelmioApiDocBundle (4.0) and LexikJWTAuthenticationBundle to create an API with Swagger. I've set up endpoints and authentication and everything is working as expected. I have fully functional API with authentication,…
2
votes
1 answer

LexikJWTAuthenticationBundle | JwtToken is working but Authentication says "Full authentication is required to access this resource."

My token login works fine, but if I try to know if I am fully logged in by my route: UserController.php /** * @Route("/auth/me", name="userIsAuthenticated") */ public function authenticated() { return new Response(':-)',…
Daniel
  • 87
  • 9
1
2
3
14 15