Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lumen #91

Closed
devmark opened this issue Apr 18, 2015 · 12 comments
Closed

lumen #91

devmark opened this issue Apr 18, 2015 · 12 comments

Comments

@devmark
Copy link

devmark commented Apr 18, 2015

hello tymon, any plan for lumen?

thanks

@tymondesigns
Copy link
Owner

Don't have anything specifically in mind.

Although I guess it could be useful to have a lumen installation running exclusively as an authentication server for issuing and revoking JWT's etc..

I'm open to any ideas though!

@emars
Copy link

emars commented Apr 18, 2015

Is it possible to use this package with Lumen as is?

@devmark
Copy link
Author

devmark commented Apr 19, 2015

it is possiable to do it, bcz tymod got a custom token function, so need to remove "auth" function for lumen
is it right?

@calebeaires
Copy link

Have someone used it with lumen and can share its job!

@iolson
Copy link

iolson commented May 13, 2015

Would love to see some code of this implemented into Lumen for User Auth and other auth methods.

@patrickwarner
Copy link

Would also appreciate this.

@tymondesigns
Copy link
Owner

Usage should be the same... You will just need to enable auth in lumen first - http://lumen.laravel.com/docs/authentication

@tymondesigns
Copy link
Owner

Next version (0.6.*) will have more considered lumen support

@osteel
Copy link

osteel commented May 28, 2015

  • Manually copy vendor/tymon/jwt-auth/src/config/config.php to app/config/jwt.php (and make changes in there as necessary)
  • Create app/Providers/CustomJWTAuthServiceProvider.php:
<?php

namespace App\Providers;

use Tymon\JWTAuth\Providers\JWTAuthServiceProvider;

/**
 * All we do here is forcing the JWTAuthServiceProvider to take
 * our custom config as the only config (force Lumen compatibility,
 * basically).
 */
class CustomJWTAuthServiceProvider extends JWTAuthServiceProvider
{
    /**
     * Boot the service provider.
     */
    public function boot()
    {
        $this->app['config']->set('jwt', require realpath(__DIR__ . '/../../config/jwt.php'));

        $this->bootBindings();

        $this->commands('tymon.jwt.generate');
    }
}
  • Install the illuminate/routing package:
$ composer require illuminate/routing
  • In bootstrap/app.php, register App\Providers\CustomJWTAuthServiceProvider instead of Tymon\JWTAuth\Providers\JWTAuthServiceProvider:
$app->register(
    'App\Providers\CustomJWTAuthServiceProvider'
);

That should do it.

@balintant
Copy link

@osteel, Works like charm! Thanks!

@KennedyTedesco
Copy link
Contributor

@tymondesigns You are doing an amazing job here! Congrats! :) Did you have any idea about how to implement "JWT as a Service" (like you said before, running exclusively as an authentication server for issuing and revoking tokens etc) with Lumen?

@hopewise
Copy link

hopewise commented Mar 3, 2016

@osteel many thanks

agungsugiarto pushed a commit to agungsugiarto/jwt-auth that referenced this issue Mar 28, 2022
…/nullable-ttl-phpdoc

docs(PHPDoc): allow nullable token ttl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants