Category: lexikjwtauthbundle

lexik JWT error invalid token while decoding token

I’ve made an authentication system with LexikJWTBundle, below are my security.yml, my service.yml and my config.yml security: encoders: FOSUserBundleModelUserInterface: bcrypt providers: fos_userbundle: id: fos_user.user_provider.username role_hierarchy: ROLE_ADMIN: ROLE_USER ROLE_SUPER_ADMIN: [ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH] firewalls: login: pattern: ^/api/login stateless: true anonymous: true provider: fos_userbundle…

How to configured multiple user entity with JWT token?

I have multiple user entities (multiple tables): AppEntityCustomer AppEntityDealer How to configured multiple user entity with JWT token? encoders: AppEntityDealer: algorithm: bcrypt AppEntityCustomer: algorithm: bcrypt providers: dealer: entity: class: AppEntityDealer property: username customer: entity: class: AppEntityCustomer property: username Source: Symfony…

Can’t get User getter in AuthenticationSuccessEvent

I tried to save User gsm data after Authentication Success Event : /** * @param AuthenticationSuccessEvent $event */ public function onAuthenticationSuccessResponse(AuthenticationSuccessEvent $event) { $data = $event->getData(); $user = $event->getUser(); dd($user); $gsm = isset(json_decode($this->requestStack->getCurrentRequest()->getContent())->gsm) ? json_decode($this->requestStack->getCurrentRequest()->getContent())->gsm : null; if ($user->getGsm()) {…

How to set cookies for response in GraphQL mutation in Symfony 5?

How to set cookies for response in GraphQL resolver in Symfony 5? I am generating JWT token in mutation resolver and I want to set this token to Http cookie. // LoginMutator.php namespace AppGraphQLMutatorsSecurity; … class LoginMutator implements MutationInterface {…