Giter Site home page Giter Site logo

irazasyed / jwt-auth-guard Goto Github PK

View Code? Open in Web Editor NEW
322.0 12.0 41.0 39 KB

JWT Auth Guard for Laravel and Lumen Frameworks.

Home Page: https://bit.ly/jwt-auth-guard

License: MIT License

PHP 100.00%
jwt jwt-authentication jwt-auth-guard laravel lumen packages composer composer-packages php auth

jwt-auth-guard's Introduction

A full-stack web developer and internet entreprenuer with over a decade of expertise.

Profile Visits Follow on GitHub Follow on Twitter


Metrics

jwt-auth-guard's People

Contributors

blacktemplar avatar imokhles avatar irazasyed avatar vegardskui avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jwt-auth-guard's Issues

[BUG] Error on $token = Auth::generateTokenById(1);

Please prefix your issue with one of the following: [BUG] [PROPOSAL] [QUESTION].

In raising this issue, I confirm the following (please check boxes):

  • I have read and understood the contributors guide.
  • I have checked that the bug-fix I am reporting can be replicated, or that the feature I am suggesting isn't already present.
  • I have checked the pull requests tab for existing solutions/implementations to my issue/suggestion.

My familiarity with the project is as follows (check one):

  • I have never used the project.
  • I have used the project briefly.
  • I have used the project extensively, but have not contributed previously.
  • I am an active contributor to the project.

My project stack details

  • Framework (Laravel / Lumen):
  • Framework Version: Laravel
  • JWT Auth Guard Version: installed today -> 1.0
  • tymon/jwt-auth Version: ^1.0@dev installed

Thanks for the "wrapper" -- spent too much trying to get the "guards" to work directly in the tymon project.

I am getting the following error though:

ErrorException in JWT.php line 59:
at HandleExceptions->handleError('4096', 'Argument 1 passed to Tymon\JWTAuth\JWT::fromUser() must be an instance of Tymon\JWTAuth\Contracts\JWTSubject, instance of App\User given, called in /Sites/tpHP/vendor/irazasyed/jwt-auth-guard/src/JwtAuthGuard.php on line 177 and defined', '/Sites/tpHP/vendor/tymon/jwt-auth/src/JWT.php', '59', array()) in JWT.php line 59

Here is the top majority of the stack trace just in case:

  1. in JWT.php line 59
  2. at HandleExceptions->handleError('4096', 'Argument 1 passed to Tymon\JWTAuth\JWT::fromUser() must be an instance of Tymon\JWTAuth\Contracts\JWTSubject, instance of App\User given, called in /Sites/tpHP/vendor/irazasyed/jwt-auth-guard/src/JwtAuthGuard.php on line 177 and defined', '/Sites/tpHP/vendor/tymon/jwt-auth/src/JWT.php', '59', array()) in JWT.php line 59
  3. at JWT->fromUser(object(User)) in JwtAuthGuard.php line 177
  4. at JwtAuthGuard->generateTokenById('37')
  5. at call_user_func_array(array(object(JwtAuthGuard), 'generateTokenById'), array('37')) in AuthManager.php line 292
  6. at AuthManager->__call('generateTokenById', array('37')) in Facade.php line 217
  7. at AuthManager->generateTokenById('37') in Facade.php line 217
  8. at Facade::__callStatic('generateTokenById', array('37')) in routes.php line 47
  9. at Auth::generateTokenById('37') in routes.php line 47
  10. at RouteServiceProvider->{closure}()
  11. at call_user_func_array(object(Closure), array()) in Route.php line 158
  12. at Route->runCallable(object(Request)) in Route.php line 137
  13. at Route->run(object(Request)) in Router.php line 724
  14. at Router->Illuminate\Routing{closure}(object(Request))
  15. at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
    .....

Example app ?

Hello, Thanks your great job.

You have any app example using tymon/jwt-auth + JWT Auth Guard?

Thanks again :)

Possible w/o Facades?

Ever considered a version that doesn't use facades so that folks with facades turned off in Lumen can use this?

Problem with installation on Laravel 8

[BUG]

On Laravel 8.10.0, i have theses issues installing jwt-auth-guard:

Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - irazasyed/jwt-auth-guard[dev-master, v1.0.0, ..., v1.0.4] require illuminate/support ~5.0 -> found illuminate/support[v5.0.0, ..., 5.8.x-dev] but these were not loaded, likely because it conflicts with another require.
    - irazasyed/jwt-auth-guard 1.0.x-dev is an alias of irazasyed/jwt-auth-guard dev-master and thus requires it to be installed too.
    - Root composer.json requires irazasyed/jwt-auth-guard ^1.0 -> satisfiable by irazasyed/jwt-auth-guard[v1.0.0, ..., 1.0.x-dev (alias of dev-master)].

Any ideas?
Thanks!
Vincent

Class tymon.jwt does not exist

Hello,

I am having problems with this library on php7-homestead.
My code is:

config/auth.php

'guards' => [
        'web' => [
            'driver' => 'session',
            'provider' => 'users',
        ],

        'api' => [
            'driver' => 'jwt-auth',
            'provider' => 'users',
        ],
    ],

config/app.php

/*
 * Vendor Service Providers...
 */
Tymon\JWTAuth\Providers\JWTAuthServiceProvider::class, 
Irazasyed\JwtAuthGuard\JwtAuthGuardServiceProvider::class,

app/Http/Kernel.php

protected $routeMiddleware = [
        'auth' => \ProteCMS\Http\Middleware\Authenticate::class,
        'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
        'guest' => \ProteCMS\Http\Middleware\RedirectIfAuthenticated::class,
        'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
        'jwt.auth' => \Tymon\JWTAuth\Middleware\GetUserFromToken::class,
        'jwt.refresh' => \Tymon\JWTAuth\Middleware\RefreshToken::class,
    ];

routes.php

$router->group(['middleware' => 'auth:api'], function ($router) {}); // etc...

I'm getting this error and I can't progress. I try with composer dumpautoload, but it doesnt work.

Thank you and sorry for my English.

captura de pantalla 2016-01-31 a las 21 23 02

Class tymon.jwt does not exist

I just updated and changed my auth.php but am now getting a ReflectionException.

ReflectionException in Container.php line 738:
Class tymon.jwt does not exist in Container.php line 738
at ReflectionClass->__construct('tymon.jwt') in Container.php line 738
at Container->build('tymon.jwt', array()) in Container.php line 633
at Container->make('tymon.jwt', array()) in Application.php line 674
at Application->make('tymon.jwt') in Container.php line 1178
at Container->offsetGet('tymon.jwt') in JwtAuthGuardServiceProvider.php line 29
at JwtAuthGuardServiceProvider->Irazasyed\JwtAuthGuard\{closure}(object(Application), 'api', array('driver' => 'jwt-auth', 'provider' => 'users')) in AuthManager.php line 92

Is there an alias that is supposed to be implement or something that is missing from the docs?

Stable version?

composer require irazasyed/jwt-auth-guard on my end returns:

[InvalidArgumentException]
Could not find package irazasyed/jwt-auth-guard at any version for your minimum-stability (stable). Check the package spelling or your minimum-stability

Method [parser] does not exist.

Hi,

I recieving the following error when i try to acess a route that is locked:
BadMethodCallException in JWTAuth.php line 330:
Method [parser] does not exist.

My config/auth.php guard:

'guards' => [
        'admin' => [
            'driver' => 'session',
            'provider' => 'admin',
        ],

        'api' => [
            'driver' => 'jwt',
            'provider' => 'users',
        ],
    ],

My route:

Route::group(['namespace' => 'API', 'prefix' => 'api/v1', 'middleware' => 'auth:api'], function () {
    Route::get('content/all', ['as' => 'content.all', 'uses' => 'ContentController@all']);
    Route::post('authenticate', ['as' => 'authenticate', 'uses' => 'AuthenticateController@authenticate']);
    // Route::post('login', ['as' => 'service.login', 'uses' => 'TestController@login']);
});

My controller:

namespace App\Http\Controllers\API;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;


class ContentController extends Controller
{
    public function __construct() 
    {
        $this->middleware('auth:api');
    }
    public function all() {
        return ["teste"];
    }
}

error trying to use Auth::

hello, I keep getting this error message:

BadMethodCallException in JWTAuth.php line 339:
Method [check] does not exist.

when trying to call Auth::guest() or any other method in the guard.

thanks

auth()->logout() results in BadRequestHttpException "Token could not be parsed from the request."

In fact, any auth() methods, using JWTAuthGuard, result in this error, unless I have immediately authenticated before. For example:

Route::get('/', function () {
    auth()->attempt(['email' => '...', 'password' => '...']);
    dd(auth()->guest()); // false
}

This is expected. But then there's this:

Route::get('/', function() {
    dd(auth()->guest()); // BadRequestHTTPException "Token could not be parsed from the request."
}

I would expect it to return 'true'.

Furthermore, this fails:

Route::get('/', function() {
    auth()->attempt(['email' => '...', 'password' => '...']);
    auth()->logout(); // BadRequestHTTPException "Token could not be parsed from the request."
}

I'm really confused here. Here is the tail of the stack trace:

in JwtAuthGuard.php line 254
at JwtAuthGuard->requireToken() in JwtAuthGuard.php line 194
at JwtAuthGuard->invalidate(true) in JwtAuthGuard.php line 153
at JwtAuthGuard->logout()
at call_user_func_array(array(object(JwtAuthGuard), 'logout'), array()) in AuthManager.php line 282
at AuthManager->__call('logout', array()) in routes.php line 17
at AuthManager->logout() in routes.php line 17
at RouteServiceProvider->{closure}()

Why does JWTAuthGuard->logout() call to invalidate(true) which calls to requireToken()? Why do I need the Authorization header to simply logout? Can anyone help clear this up?

authentication error

Please prefix your issue with one of the following: [BUG] [PROPOSAL] [QUESTION].

In raising this issue, I confirm the following (please check boxes):

  • I have read and understood the contributors guide.
  • I have checked that the bug-fix I am reporting can be replicated, or that the feature I am suggesting isn't already present.
  • I have checked the pull requests tab for existing solutions/implementations to my issue/suggestion.

My familiarity with the project is as follows (check one):

  • I have never used the project.
  • [*] I have used the project briefly.
  • I have used the project extensively, but have not contributed previously.
  • I am an active contributor to the project.

My project stack details

  • Framework (Laravel / Lumen): Laravel
  • Framework Version: 5.2
  • JWT Auth Guard Version: 1@dev

- tymon/jwt-auth Version: 1.0.4

Type error: Argument 1 passed to Irazasyed\JwtAuthGuard\JwtAuthGuard::login() must be an instance of Tymon\JWTAuth\Contracts\JWTSubject, instance of App\User given, called in /home/cargie/Projects/Php/dbventures2/vendor/irazasyed/jwt-auth-guard/src/JwtAuthGuard.php on line 114

ErrorException in JwtAuthGuard.php line 127

Please prefix your issue with one of the following: [BUG] [PROPOSAL] [QUESTION].

In raising this issue, I confirm the following (please check boxes):

  • I have read and understood the contributors guide.
  • I have checked that the bug-fix I am reporting can be replicated, or that the feature I am suggesting isn't already present.
  • I have checked the pull requests tab for existing solutions/implementations to my issue/suggestion.

My familiarity with the project is as follows (check one):

  • I have never used the project.
  • I have used the project briefly.
  • I have used the project extensively, but have not contributed previously.
  • I am an active contributor to the project.

My project stack details

  • Framework (Laravel):
  • Framework Version: 5.3.28
  • JWT Auth Guard Version: ^1.0
  • tymon/jwt-auth Version: ^1.0@dev

After follow the steps (even that one, #5 (comment)), I'm getting:

Argument 1 passed to Irazasyed\JwtAuthGuard\JwtAuthGuard::login() must implement interface Tymon\JWTAuth\Contracts\JWTSubject, instance of Illuminate\Auth\GenericUser given, called in /var/www/anbi-api/vendor/irazasyed/jwt-auth-guard/src/JwtAuthGuard.php on line 114 and defined

More details:

in JwtAuthGuard.php line 127 at HandleExceptions->handleError('4096', 'Argument 1 passed to Irazasyed\JwtAuthGuard\JwtAuthGuard::login() must implement interface Tymon\JWTAuth\Contracts\JWTSubject, instance of Illuminate\Auth\GenericUser given, called in /var/www/anbi-api/vendor/irazasyed/jwt-auth-guard/src/JwtAuthGuard.php on line 114 and defined', '/var/www/anbi-api/vendor/irazasyed/jwt-auth-guard/src/JwtAuthGuard.php', '127', array()) in JwtAuthGuard.php line 127 at JwtAuthGuard->login(object(GenericUser)) in JwtAuthGuard.php line 114 at JwtAuthGuard->attempt(array('email' => '[email protected]', 'password' => 12345)) in AuthManager.php line 294 at AuthManager->__call('attempt', array(array('email' => '[email protected]', 'password' => 12345))) in Facade.php line 237 at AuthManager->attempt(array('email' => '[email protected]', 'password' => 12345)) in Facade.php line 237 at Facade::__callStatic('attempt', array(array('email' => '[email protected]', 'password' => 12345))) in AuthController.php line 32 at Auth::attempt(array('email' => '[email protected]', 'password' => 12345)) in AuthController.php line 32 at AuthController->authenticate(object(Request)) at call_user_func_array(array(object(AuthController), 'authenticate'), array(object(Request))) in Controller.php line 55 at Controller->callAction('authenticate', array(object(Request))) in ControllerDispatcher.php line 44 at ControllerDispatcher->dispatch(object(Route), object(AuthController), 'authenticate') in Route.php line 190 at Route->runController() in Route.php line 144 at Route->run(object(Request)) in Router.php line 653 at Router->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in SubstituteBindings.php line 41 at SubstituteBindings->handle(object(Request), object(Closure)) in Pipeline.php line 137 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in ThrottleRequests.php line 49 at ThrottleRequests->handle(object(Request), object(Closure), '60', '1') in Pipeline.php line 137 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 104 at Pipeline->then(object(Closure)) in Router.php line 655 at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 629 at Router->dispatchToRoute(object(Request)) in Router.php line 607 at Router->dispatch(object(Request)) in Kernel.php line 268 at Kernel->Illuminate\Foundation\Http\{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 46 at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 137 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 104 at Pipeline->then(object(Closure)) in Kernel.php line 150 at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 117 at Kernel->handle(object(Request)) in index.php line 54

...I don't know if it is the version of Laravel (5.3.28) or my Model ('cause I don't use eloquent), is there something else to do that I miss?

JWT Auth now includes a Guard.

Hi

I was having odd issues with attribute mutating that came down to jwt-auth-guard in some way. I switched to jwt auths 1.0 dev guard and all was resolved.

Just set the driver to jwt in your config/app.php

        'api' => [
            'driver' => 'jwt',
            'provider' => 'users',
        ],

For some reason I was not able to mutate attributes with id_ or _id, $this->attributes['...']; would cause the Fatal error: Maximum function nesting level of '256' reached, aborting!.

Error when using guard

Error message that appears when 'auth:api' or 'auth' are added as middleware:

ErrorException in AuthManager.php line 246: call_user_func_array() expects parameter 1 to be a valid callback, class 'Irazasyed\JwtAuthGuard\JwtAuthGuard' does not have a method 'handle'

Guard for 'api' is set to 'jwt':

    'guards'    => [
        'web' => [
            'driver'   => 'session',
            'provider' => 'users',
        ],
        'api' => [
            'driver'   => 'jwt',
            'provider' => 'users',
        ],
    ],

I am on the stable branch of Laravel, v5.2.10 of the framework.

I will take some time tomorrow to track down what is going on, but I am hoping that it's an error that you might have solution for already.

[QUESTION] Auth::attempt does not return token

Please prefix your issue with one of the following: [BUG] [PROPOSAL] [QUESTION].

In raising this issue, I confirm the following (please check boxes):

  • I have read and understood the contributors guide.
  • I have checked that the bug-fix I am reporting can be replicated, or that the feature I am suggesting isn't already present.
  • I have checked the pull requests tab for existing solutions/implementations to my issue/suggestion.

My familiarity with the project is as follows (check one):

  • I have never used the project.
  • I have used the project briefly.
  • I have used the project extensively, but have not contributed previously.
  • I am an active contributor to the project.

My project stack details

  • Framework (Laravel / Lumen): Laravel
  • Framework Version: v5.2.45
  • JWT Auth Guard Version: v1.0.4
  • tymon/jwt-auth Version: ^1.0@dev

{issue content here}
$token = Auth::attempt(['email' => '[email protected]', 'password' => '123456']); returns true instead of token as stated in documentation. May I know if I missed anything?

[BUG] "Class tymon.jwt does not exist" - Laravel 5.4

In raising this issue, I confirm the following (please check boxes):

  • I have read and understood the contributors guide.
  • I have checked that the bug-fix I am reporting can be replicated, or that the feature I am suggesting isn't already present.
  • I have checked the pull requests tab for existing solutions/implementations to my issue/suggestion.

My familiarity with the project is as follows (check one):

  • I have never used the project.
  • I have used the project briefly.
  • I have used the project extensively, but have not contributed previously.
  • I am an active contributor to the project.

My project stack details

  • Framework (Laravel):
  • Framework Version: 5.4
  • JWT Auth Guard Version: ^1.0
  • tymon/jwt-auth Version: 0.5.*

Laravel 5.4 throws the error "Class tymon.jwt does not exist" after installing jwt-auth-guard and configuring it as described in the docs.

tymon.jwt does not exist

Hey,

I'm getting error when try to use:
Auth::attempt($credentials);

The error:
ReflectionException in Container.php line 736:
Class tymon.jwt does not exist

I've register the services providers:
$app->register(Tymon\JWTAuth\Providers\JWTAuthServiceProvider::class);
$app->register(Irazasyed\JwtAuthGuard\JwtAuthGuardServiceProvider::class);

Using Lumen 5.2.

Method [check] does not exist.

Hi,
I'm trying to authenticate my user, but when I try to retrieve the user's data, I get this error:

Method [check] does not exist.

this is my authentication code, which works perfectly.

if (! $token = Auth::guard('companies')->attempt($credentials)) { return response()->json(['error' => 'invalid_credentials'], 401); }

then I try to retrieve the company like this:

$user = Auth::user()

But I get Method [check] does not exist., There is no check method in JwtAuthGuard.php, should I include JWTAuth somehow or is this just a problem with the library itself?
If I remove || ! $this->jwt->check() from JwtAuthGuard.php line 62, everything works fine.
Thanks.

Lumen configuration

Not clear on how to implement in Lumen. The readme seems to refer to a laravel instance from the 'Usage' section. Where can i set the Guard driver in Lumen?

[QUESTION] Rate Limiting Does Not Work

In raising this issue, I confirm the following (please check boxes):

  • I have read and understood the contributors guide.
  • I have checked that the bug-fix I am reporting can be replicated, or that the feature I am suggesting isn't already present.
  • I have checked the pull requests tab for existing solutions/implementations to my issue/suggestion.

My familiarity with the project is as follows (check one):

  • I have never used the project.
  • I have used the project briefly.
  • I have used the project extensively, but have not contributed previously.
  • I am an active contributor to the project.

My project stack details

  • Framework (Laravel / Lumen): Laravel
  • Framework Version: 5.2
  • JWT Auth Guard Version: ^1.0
  • tymon/jwt-auth Version: ^1.0@dev

When adding the guard, the throttle options for the Laravel API middleware does not seem to work. Is there a way to get this working?

[Question] Class tymon.jwt does not exist?

My familiarity with the project is as follows (check one):

  • I have never used the project.
  • I have used the project briefly.
  • I have used the project extensively, but have not contributed previously.
  • I am an active contributor to the project.

My project stack details

  • Framework (Laravel / Lumen): Lumen
  • Framework Version: v5.4.6
  • JWT Auth Guard Version: v1.0.4
  • tymon/jwt-auth Version: v1.0.0-beta.3

Error: Class tymon.jwt does not exists

auth.php


<?php

return [

    'defaults' => [
        'guard' => env('AUTH_GUARD', 'api'),
        'passwords' => 'users',
    ],

    'guards' => [
        'web' => [
            'driver' => 'session',
            'provider' => 'users',
        ],

        'api' => [
            'driver' => 'jwt-auth',
            'provider' => 'users',
        ],
    ],

    'providers' => [
        'users' => [
            'driver' => 'eloquent',
            'model' => App\User::class,
        ],
    ],

    'passwords' => [
        'users' => [
            'provider' => 'users',
            'table' => 'password_resets',
            'expire' => 60,
        ],
    ],

];

web.php

very simple route

$app->get('users', ['middleware' => 'auth:api', 'uses' => 'App\Http\Controllers\UsersController@all' ]);

bootstrap/app.php

service provider

$app->register(Irazasyed\JwtAuthGuard\JwtAuthGuardServiceProvider::class);

Any Ideas?

jwt auth guard not working properly with Laravel 5.3

[BUG]
Token generated by client guard Works for the other guard too.
app cannot distinguish the generated token is client or employee token.

'admin' => [
'driver' => 'jwt-auth',
'provider' => 'admins',
],
'client' => [
'driver' => 'jwt-auth',
'provider' => 'clients',
],
'employee' => [
'driver' => 'jwt-auth',
'provider' => 'employees',
]

Route

Route::group(['prefix' => 'v1'], function () {
Route::group(['prefix' => 'client'], function (){
Route::any('login', 'ClientController@login');

    Route::group([ 'middleware' => ['auth:client']], function (){
        Route::get('detail', 'ClientController@authenticated');

        Route::resource('item', 'itemController');
    });
});

Route::group(['prefix' => 'employee'], function () {
    Route::any('login', 'EmployeeController@login');

    Route::group([ 'middleware' => ['auth:employee']], function (){
        Route::get('detail', 'EmployeeController@authenticated');

        Route::resource('item', 'itemController');
    });
});

Route::resource('user', 'UserController');
Route::resource('item', 'itemController');

});

jwt auth | guard doesnt distinguish the client token or employee token.
Token generated by client guard give the access to both client and employee access

Not supported with Laravel 6.18.35

Please prefix your issue with one of the following: [BUG] [PROPOSAL] [QUESTION].

In raising this issue, I confirm the following (please check boxes):

[ ] I have read and understood the contributors guide.
[ ] I have checked that the bug-fix I am reporting can be replicated, or that the feature I am suggesting isn't already present.
[ ] I have checked the pull requests tab for existing solutions/implementations to my issue/suggestion.

My familiarity with the project is as follows (check one):

[ ] I have never used the project.
[ ] I have used the project briefly.
[ ] I have used the project extensively, but have not contributed previously.
[ ] I am an active contributor to the project.

My project stack details

  • Framework (Laravel): 6.18.35
  • JWT Auth Guard Version: 1.0.4
  • tymon/jwt-auth Version: ^1.0@dev

I am unable to install the Auth guard

When I install as dev and it not working for any of the versions as in the error

Problem 1
   - Conclusion: don't install irazasyed/jwt-auth-guard v1.0.4
   - Conclusion: don't install irazasyed/jwt-auth-guard v1.0.3
   - Conclusion: don't install irazasyed/jwt-auth-guard v1.0.2
   - Conclusion: don't install irazasyed/jwt-auth-guard v1.0.1
   - Installation request for laravel/framework (locked at v6.20.8, required as ^6.18.35) -> satisfiable by laravel/framework[v6.20.8].
   - Conclusion: don't install irazasyed/jwt-auth-guard v1.0.0
   - Conclusion: don't install irazasyed/jwt-auth-guard dev-master
   - don't install irazasyed/jwt-auth-guard 1.0.x-dev|install irazasyed/jwt-auth-guard dev-master
   - Installation request for irazasyed/jwt-auth-guard @dev -> satisfiable by irazasyed/jwt-auth-guard[dev-master, 1.0.x-dev, v1.0.0, v1.0.1, v1.0.2, v1.0.3, v1.0.4].

Not working on laravel 5.3

[BUG]

In raising this issue, I confirm the following (please check boxes):

  • I have read and understood the contributors guide.
  • I have checked that the bug-fix I am reporting can be replicated, or that the feature I am suggesting isn't already present.
  • I have checked the pull requests tab for existing solutions/implementations to my issue/suggestion.

My familiarity with the project is as follows (check one):

  • I have never used the project.
  • I have used the project briefly.
  • I have used the project extensively, but have not contributed previously.
  • I am an active contributor to the project.

My project stack details

  • Framework (Laravel / Lumen): Laravel
  • Framework Version: 5.3.2
  • JWT Auth Guard Version: 1.0.4
  • tymon/jwt-auth Version: dev-master

I have an error Class tymon.jwt does not exist.
I cant install tymon/jwt-auth:^1.0@dev, because dependecies changed

what about exception handling ?

what about exception handling ?

for example without exceptions

$user = $this->auth->user();

will return null if token not provided ,Invalid ,blacklisted , Expired ....

Getting 'Could not find package'

Hello, I'm getting this error.

  [InvalidArgumentException]                                                                                                                                
  Could not find package irazasyed/jwt-auth-guard at any version for your minimum-stability (stable). Check the package spelling or your minimum-stability  

Composer require not working

Hey!

I am trying to use your package, but with no luck so far:

Could not find package irazasyed/jwt-auth-guard at any version for your minimum-stability (stable). Check the package spelling or your minimum-stability

Hope you can rectify this soon,

Thanks,

Ed

I get tymon.jwt does not exist

Hello I get error on Laravel 5.2
ReflectionException in Container.php line 738:
Class tymon.jwt does not exist

I install and configure first tymon/jwt-auth

Not Work

Please prefix your issue with one of the following: [BUG] [PROPOSAL] [QUESTION].

In raising this issue, I confirm the following (please check boxes):

  • I have read and understood the contributors guide.
  • I have checked that the bug-fix I am reporting can be replicated, or that the feature I am suggesting isn't already present.
  • I have checked the pull requests tab for existing solutions/implementations to my issue/suggestion.

My familiarity with the project is as follows (check one):

  • I have never used the project.
  • I have used the project briefly.
  • I have used the project extensively, but have not contributed previously.
  • I am an active contributor to the project.

My project stack details

  • Framework (Laravel / Lumen):
  • Framework Version:
  • JWT Auth Guard Version:
  • tymon/jwt-auth Version:

Should I add route Middleware in kernel.php for 'jwt-auth' ?

Doesn't work with laravel 5.2

I have just setup like your documentation, but it does'nt work.

I have this message

InvalidArgumentException in AuthManager.php line 97:
Auth guard driver [api] is not defined.

[QUESTION] The "jwt-auth"&"jwt.auth" confusing problem

Please prefix your issue with one of the following: [BUG] [PROPOSAL] [QUESTION].

In raising this issue, I confirm the following (please check boxes):

  • I have read and understood the contributors guide.
  • I have checked that the bug-fix I am reporting can be replicated, or that the feature I am suggesting isn't already present.
  • I have checked the pull requests tab for existing solutions/implementations to my issue/suggestion.

My familiarity with the project is as follows (check one):

  • I have never used the project.
  • I have used the project briefly.
  • I have used the project extensively, but have not contributed previously.
  • I am an active contributor to the project.

My project stack details

  • Framework (Laravel / Lumen): laravel
  • Framework Version: 5.2
  • JWT Auth Guard Version: 1.0.4
  • tymon/jwt-auth Version: ^1.0@dev

In the latest jwt-auth (1.0 above), there is a LaravelServiceProvider.php file, and the default short key of the "Authenticate::class" middleware is "jwt.auth". Should it be extended from the "jwt.auth" rather than "jwt-auth" in the JwtAuthGuardServiceProvider.php ?
This is a place easy to make mistakes,especially for beginners. The error is as follows:
Auth guard driver [api] is not defined.
BTW. the document need an updating : )

problem with logout

Hello, I am trying to logout but i think something is wrong or maybe im not understanding it well, wehn you logout it calls to invalidate on the JWTAuth library, but that library method signature is:

public function invalidate($token = false)

And the JWTAuthGuard calls:

/**
     * Invalidate current token (add it to the blacklist).
     *
     * @param  boolean $forceForever
     *
     * @return boolean
     */
    public function invalidate($forceForever = false)
    {
        return $this->requireToken()->invalidate($forceForever);
    }

Also:

Method [unsetToken] does not exist.

Which is sending a boolean instead of the token.

is that correct? am i doing something wrong?

Thanks

Which version of tymon/jwt-auth is this package suposed to work with?

Which version of tymon/jwt-auth is this package suposed to work with?

With v5.6 which is on the master branch I get that

Class tymon.jwt does not exist

I solved that by switching to v6 on the development branch of tymon/jwt-auth , but when I use the development branch, I now get

Type error: Argument 1 passed to Tymon\JWTAuth\JWT::fromUser() must be an instance of Tymon\JWTAuth\Contracts\JWTSubject, instance of App\Models\User given, called in C:\xampp\htdocs\projects\adance\vendor\irazasyed\jwt-auth-guard\src\JwtAuthGuard.php on line 117

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.