Comments (25)
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
from lumen-passport.
https://github.com/dusterio/lumen-passport/blob/master/src/PassportServiceProvider.php
you can find the passport source code in vendor/laravel/passport
from lumen-passport.
those are only suggestion package. Nothing blocking. you can install them if you want or not.
from lumen-passport.
passport routes are already configured. You just have to use them. They are already registered
from lumen-passport.
For example
set the verb as post and the request body as
{
"username" : "[email protected]",
"password" : "yourPassword",
"client_id" : "youClientId",
"client_secret" : "yourClientSecret",
"grant_type" : "password"
}
of course you have to save in the db a user with email = "[email protected]" and "password" = "yourPassword", and a client.
You can read the doc for more info https://laravel.com/docs/5.3/passport#introduction
from lumen-passport.
Did you registered the routes correctly? See https://github.com/dusterio/lumen-passport#registering-routes
from lumen-passport.
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
from lumen-passport.
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.
from lumen-passport.
can you give me whole source code of lumen with running passport please? I tried thrice time But I failed.
from lumen-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)
from lumen-passport.
Thank you dear. I reached to the final stage. one more help please sorry for asking again and again.
here is my route.php
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?from lumen-passport.
Just WoW brother Thanks alot. its magic 👯♂️ nothing to do. Thanks @paolopiccinini and @dusterio
from lumen-passport.
How to issue token? Should I pass parameters with the the issueToken route?
from lumen-passport.
ok Thanks alot. :)
from lumen-passport.
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
from lumen-passport.
you have to point in your application root
localhost:8000/oauth/token it's missing your app
localhost:8000/[app-root]/oauth/token
from lumen-passport.
try using
Dusterio\LumenPassport\LumenPassport::routes($router);
instead of
Dusterio\LumenPassport\LumenPassport::routes($app);
from lumen-passport.
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);
from lumen-passport.
@ahmdabos what Lumen version are you using and what lumen-passport package version?
from lumen-passport.
lumen is 5.4 and lumen passport is latest
from lumen-passport.
I'm really having trouble @dusterio
lumen is 5.5
Class App\Http\Controllers\Dusterio\LumenPassport\Http\Controllers\AccessTokenController does not exist
from lumen-passport.
@Jvgm @dusterio I'm having the same problem.
Class App\Http\Controllers\Dusterio\LumenPassport\Http\Controllers\AccessTokenController does not exist
from lumen-passport.
got same issue, I've to downgrade to 0.2.0 to avoid this
from lumen-passport.
@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?
from lumen-passport.
this is the similar issue with routes and might help someone depending on thier versions of Lumen, LaravelPassport and LumenPassport:
#47
from lumen-passport.
Related Issues (20)
- Refresh Token HOT 1
- token expire at now work HOT 1
- Unable to resolve dependency [Parameter #1 [ <required> $tokenId ]] in class Laravel\Passport\Http\Controllers\AuthorizedAccessTokenController HOT 4
- Error 400, error": "invalid_grant" HOT 7
- NotFoundHttpException HOT 5
- PHP 8 Support
- It's not working with mongodb
- Is this repository dead?
- php artisan passport:install error. HOT 1
- Lumen passport custom data in payload HOT 5
- Using Multiple Authentication
- How to load the passport keys from different folder ?
- create client password grant each user
- getting error on install passport in lumen 9 HOT 2
- not support lumen 9 HOT 12
- getting error on install passport in lumen 9 HOT 22
- Restrictions with models
- Error with Lumen 10x HOT 15
- Call to undefined method Laravel\Lumen\Routing\Router::middleware() HOT 3
- Getting error on installation for Lumen 10.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lumen-passport.