GithubHelp home page GithubHelp logo

routes not mounted about lumen-passport HOT 25 CLOSED

dusterio avatar dusterio commented on May 10, 2024
routes not mounted

from lumen-passport.

Comments (25)

sanjukaniyamattam avatar sanjukaniyamattam commented on May 10, 2024 3

Follow this link
https://github.com/dusterio/lumen-passport

Only one change you have to do is in the Registering Routes Step

  1. Open AuthServiceProvider.php in your app/Providers folder, add
    use Dusterio\LumenPassport\LumenPassport;

  2. 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

  1. Run
    composer require appzcoder/lumen-routes-list

  2. Add service provider into /bootstrap/app.php file.
    $app->register(Appzcoder\LumenRoutesList\RoutesCommandServiceProvider::class);

  3. Run composer dump-autoload

from lumen-passport.

paolopiccinini avatar paolopiccinini commented on May 10, 2024 1

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.

paolopiccinini avatar paolopiccinini commented on May 10, 2024 1

those are only suggestion package. Nothing blocking. you can install them if you want or not.

from lumen-passport.

paolopiccinini avatar paolopiccinini commented on May 10, 2024 1

passport routes are already configured. You just have to use them. They are already registered

from lumen-passport.

paolopiccinini avatar paolopiccinini commented on May 10, 2024 1

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.

desyncr avatar desyncr commented on May 10, 2024 1

Did you registered the routes correctly? See https://github.com/dusterio/lumen-passport#registering-routes

from lumen-passport.

ronnie-depp avatar ronnie-depp commented on May 10, 2024 1

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.

paolopiccinini avatar paolopiccinini commented on May 10, 2024

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.

rajaunleashed avatar rajaunleashed commented on May 10, 2024

can you give me whole source code of lumen with running passport please? I tried thrice time But I failed.

from lumen-passport.

rajaunleashed avatar rajaunleashed commented on May 10, 2024

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.

rajaunleashed avatar rajaunleashed commented on May 10, 2024

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.

rajaunleashed avatar rajaunleashed commented on May 10, 2024

Just WoW brother Thanks alot. its magic 👯‍♂️ nothing to do. Thanks @paolopiccinini and @dusterio

from lumen-passport.

rajaunleashed avatar rajaunleashed commented on May 10, 2024

How to issue token? Should I pass parameters with the the issueToken route?

from lumen-passport.

rajaunleashed avatar rajaunleashed commented on May 10, 2024

ok Thanks alot. :)

from lumen-passport.

perogeremmer avatar perogeremmer commented on May 10, 2024

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.

paolopiccinini avatar paolopiccinini commented on May 10, 2024

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.

tdavincci avatar tdavincci commented on May 10, 2024

try using
Dusterio\LumenPassport\LumenPassport::routes($router);
instead of
Dusterio\LumenPassport\LumenPassport::routes($app);

from lumen-passport.

ahmdabos avatar ahmdabos commented on May 10, 2024

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.

dusterio avatar dusterio commented on May 10, 2024

@ahmdabos what Lumen version are you using and what lumen-passport package version?

from lumen-passport.

ahmdabos avatar ahmdabos commented on May 10, 2024

lumen is 5.4 and lumen passport is latest

from lumen-passport.

galvaodev avatar galvaodev commented on May 10, 2024

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.

natemacs avatar natemacs commented on May 10, 2024

@Jvgm @dusterio I'm having the same problem.

Class App\Http\Controllers\Dusterio\LumenPassport\Http\Controllers\AccessTokenController does not exist

from lumen-passport.

tshwangq avatar tshwangq commented on May 10, 2024

got same issue, I've to downgrade to 0.2.0 to avoid this

from lumen-passport.

dusterio avatar dusterio commented on May 10, 2024

@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.

ronnie-depp avatar ronnie-depp commented on May 10, 2024

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)

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.