lexikjwtauthbundle

401 JWT Token not found

主宰稳场 提交于 2019-12-06 09:24:54
I provided two versions of the security.yaml file. The second version according to API Platform documentation. API Platform sends to the creation a custom user provider . For the second option security.yaml recommended at API Platform docs, I need to create two additional files. I did not attach them to the topic, but will do it if necessary. But I think that problem it is in JWT. Environment: node v8.9.4 chrome 64.0.3282.119 Ubuntu 16.04 axios version: 0.16.2 Vue.js 2.4.2 vue-axios 2.0.2 api-platform/api-pack: 1.0 Symfony 4.0.4 User.php <?php namespace App\Entity; use Doctrine\ORM\Mapping as

Why my jwt tokens never expire?

孤街浪徒 提交于 2019-12-06 07:35:00
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'); $password = $request->request->get('password'); $user = $this->get('fos_user.user_manager') ->findUserByUsername($username); if (!$user) { throw $this->createNotFoundException(); } $passwordEncoder = $this->get('security.password_encoder'); if(!$passwordEncoder->isPasswordValid($user, $password)) { throw $this->createAccessDeniedException(); } $groups = ['foo',

Symfony 4: Test DB for JWT and Behat

人盡茶涼 提交于 2019-12-06 04:48:43
问题 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 @dropSchema Scenario: Adding a new book When I add "Content-Type" header equal to "application/json" And I add "Accept" header equal to "application/json" And I send a "POST" request to "/api/books" with body: """ { "title": "King", "author": "T. M.

Symfony 4: Test DB for JWT and Behat

邮差的信 提交于 2019-12-04 11:18:41
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 @dropSchema Scenario: Adding a new book When I add "Content-Type" header equal to "application/json" And I add "Accept" header equal to "application/json" And I send a "POST" request to "/api/books" with body: """ { "title": "King", "author": "T. M. Frazier", "enabled": true } """ Then the response status code should be 201 And the response should be in

Symfony 2 FOSUserBundle with rest login and registration

﹥>﹥吖頭↗ 提交于 2019-12-04 08:23:06
问题 I have gone through lots of stackoveflow question and articles, but can't find a suitable answer. I'm using fosuserbundle, hwiouthbundle and lexikjwt bundle. I'm developing an api based on symfony which will be consumed by an android app and angular app. Now I need the register and login system with fosuserbundle facebook login with hwiouthbundle and api protection with lexikjwt bundle. I have implemented fosuserbundle and hwiouthbundke and both working without even writing user controller.

Symfony 2 FOSUserBundle with rest login and registration

落花浮王杯 提交于 2019-12-02 21:19:49
I have gone through lots of stackoveflow question and articles, but can't find a suitable answer. I'm using fosuserbundle, hwiouthbundle and lexikjwt bundle. I'm developing an api based on symfony which will be consumed by an android app and angular app. Now I need the register and login system with fosuserbundle facebook login with hwiouthbundle and api protection with lexikjwt bundle. I have implemented fosuserbundle and hwiouthbundke and both working without even writing user controller. But I need this with rest not with form. But I can't out type : rest in router. Now how can I login,