Closed rajaunleashed closed 8 years ago
The route are mounted in Dusterio\LumenPassport\PassportServiceProvider. passport:install configure the keys to use when generating token. passport:migrate generate the db-table requred from passport.
can you give me whole source code of lumen with running passport please? I tried thrice time But I failed.
https://github.com/dusterio/lumen-passport/blob/master/src/PassportServiceProvider.php
you can find the passport source code in vendor/laravel/passport
When I am installing the package it shows me the following message after installation of package.
phpseclib/phpseclib suggests installing ext-libsodium (SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.) lcobucci/jwt suggests installing mdanter/ecc (Required to use Elliptic Curves based algorithms.) league/oauth2-server suggests installing indigophp/hash-compat (Polyfill for hash_equals function for PHP 5.5)
those are only suggestion package. Nothing blocking. you can install them if you want or not.
Thank you dear. I reached to the final stage. one more help please sorry for asking again and again.
here is my route.php
<?php
$app->post('/oauth/token', '\Laravel\Passport\Http\Controllers\AccessTokenController@issueToken');
it gives me the error. Class App\Http\Controllers\Laravel\Passport\Http\Controllers\AccessTokenController does not exist
how to access those classes as they are in vendor folder?
passport routes are already configured. You just have to use them. They are already registered
Just WoW brother Thanks alot. its magic 👯♂️ nothing to do. Thanks @paolopiccinini and @dusterio
How to issue token? Should I pass parameters with the the issueToken route?
For example set the verb as post and the request body as { "username" : "yourEmail@email.com", "password" : "yourPassword", "client_id" : "youClientId", "client_secret" : "yourClientSecret", "grant_type" : "password" } of course you have to save in the db a user with email = "yourEmail@email.com" and "password" = "yourPassword", and a client. You can read the doc for more info https://laravel.com/docs/5.3/passport#introduction
ok Thanks alot. :)
hello, i already follow all the steps but i have same issue here, it brings me http not found exception._. can you help me? i can't access the token, everytime i want to get the token with post localhost:8000/oauth/token and raw body i can't. It bring me to http not found exception. What happened? i am using Lumen 5.4
Did you registered the routes correctly? See https://github.com/dusterio/lumen-passport#registering-routes
you have to point in your application root
localhost:8000/oauth/token it's missing your app
localhost:8000/[app-root]/oauth/token
I'm having the same issue. I have tried Lumen 5.4 & 5.5.
@desyncr I was unable to Register the Routes as you pointed out. Because when I pass $app to:
Dusterio\LumenPassport\LumenPassport::routes($app);
it gives me error saying $app is undefined. And when I replace $app with app()
Dusterio\LumenPassport\LumenPassport::routes(app());
it says that group method is undefined in Dusterio\LumenPassport\LumenPassport::routes
line#83 as $callback->group is replaced by Laravel\Lumen\Application->group()
@paolopiccinini how to get the Application-Root? Please point out.
PLEASE HELP @dusterio @kiddyatreides @rajaunleashed @andrew-s
try using Dusterio\LumenPassport\LumenPassport::routes($router); instead of Dusterio\LumenPassport\LumenPassport::routes($app);
hello , i have same issue when i call http://localhost/lumen-app/public/oauth/token its give me NotFoundHttpException this is how i register the route in authServiceProvider: LumenPassport::routes($this->app);
@ahmdabos what Lumen version are you using and what lumen-passport package version?
lumen is 5.4 and lumen passport is latest
I'm really having trouble @dusterio lumen is 5.5
Class App\Http\Controllers\Dusterio\LumenPassport\Http\Controllers\AccessTokenController does not exist
@jvgm @dusterio I'm having the same problem.
Class App\Http\Controllers\Dusterio\LumenPassport\Http\Controllers\AccessTokenController does not exist
got same issue, I've to downgrade to 0.2.0 to avoid this
@tshwangq @jvgm @NathanMacedo hmm that's very strange - I tested on both 5.4 and 5.5, my route:list displays correct namespace: POST | /oauth/token | | \Dusterio\LumenPassport\Http\Controllers\AccessTokenController | issueToken
Are you sure you have the lastest Lumen Passport? There was an issue from another PR that I fixed recently.
If you are sure it's the latest version, can you show how and where you run LumenPassport::routes() call?
Follow this link https://github.com/dusterio/lumen-passport
Only one change you have to do is in the Registering Routes Step
Open AuthServiceProvider.php in your app/Providers folder, add use Dusterio\LumenPassport\LumenPassport;
Inside the boot() function, add: LumenPassport::routes($this->app->router, ['prefix' => 'v1/oauth']);
Also in bootstrap/app.php by default below 2 lines will be commented $app->register(App\Providers\AppServiceProvider::class); $app->register(App\Providers\AuthServiceProvider::class); Just uncomment it.
===================================================
If your php artisan route:list is not working then
Run composer require appzcoder/lumen-routes-list
Add service provider into /bootstrap/app.php file. $app->register(Appzcoder\LumenRoutesList\RoutesCommandServiceProvider::class);
Run composer dump-autoload
this is the similar issue with routes and might help someone depending on thier versions of Lumen, LaravelPassport and LumenPassport: https://github.com/dusterio/lumen-passport/issues/47
Hi,
I followed all the steps but the routes are not mounted there in lumen route folder? I didn't understand this line? I think I am doing something wrong after the passport:install command.
"Adding this service provider, will mount the following routes:" What's the meaning of this line?