Skip to content

Tag: jwt

Failed Login with Tymon JWT Auth Laravel 8

When I try to get token with login function I get this error TypeError: Argument 1 passed to TymonJWTAuthJWTGuard::login() must be an instance of TymonJWTAuthContractsJWTSubject, instance of AppModelsUser given, called in …vendortymonjwt-authsrcJWTGuard.php on line 127 in file …vendortymonjwt-auth…

How to call a class from vendor folder when using a composer?

I am investigating jwt token examples from this link – https://github.com/firebase/php-jwt So i run: And now i have new files and folders in my root directory of my site: vendor, composer.json and composer.lock. Folder “vendor” contents “firebase/php-jwt” folder. So i tried to ru…

Check JWT (Firebase) Token with Symfony 5.3

I’m working on an API, and I had implemented a JWT to make it stateless. I created an AuthController, which returns a JWT when login information is correct. Here you can see the return code that generates the token: This is the result when I run the authenticate method, un the URL localhost:8000/authent…

I can’t get JWT token in Laravel

I am creating an API in Laravel 8 (PHP 7.4) and I wanted to secure it. The choice fell on tymon / jwt-auth. I follow the documentation from the website: https://jwt-auth.readthedocs.io/en/develop/quick-start/ Everything works fine here. However, later when I create a route to login and want to get the token u…

PHP get JSON Web Token with Guzzle

I use Laravel 5.3 with GuzzleHttp 7 and want to make an API-Call to another Server in order to authorize and get a JSON Web Token in return. The curl command runs perfectly fine and returns a JSON Web Token with status code 200: In PHP: Answer I have made small changes to your code to make it more better,

PHP JWT (JSON Web Token) with RSA signature without library

Anyboby know some solution in PHP to using JWT (JSON Web Token) with RSA signature without library? I tried so hard to find solutions without library or without using composer. All the options that I found use some kind of library. Answer I made my own solution using other examples on the way. Below we have 3…