dusterio / lumen-passport

Making Laravel Passport work with Lumen
MIT License
655 stars 138 forks source link

oauth/authorize page not found #4

Closed ursuleacv closed 7 years ago

ursuleacv commented 8 years ago

When I redirect to oauth/authorize I get: Sorry, the page you are looking for could not be found.

In Passport documentation is saying to add

Passport::routes();

in AuthServiceProvider

Because

Remember, the /oauth/authorize route is already defined by the Passport::routes method. You do not need to manually define this route.

How can I make it work? Where do I need to add Passport::routes();? I am using dusterio/lumen-passport

codedge commented 8 years ago

@ursuleacv The oauth/authorize route may be stripped from this package. The reason why I see in Lumen being an API-centric framework - the authorize route basically only provides a frontend for confirming that the consuming application may access.

Furthermore I cannot see an authorize route in the Service Provider bundled with this package.

You need to remember that you should build a RESTful API with Lumen - frontend stuff is handled somewhere else.

ursuleacv commented 8 years ago

That means I should have two apps, both including Passport. It doesn't really make sense to use Passport with Lumen.

dusterio commented 8 years ago

@ursuleacv yes, it makes sense to have two apps - one is OAuth2 server itself, another one is a front-end app that uses its own OAuth client ID and secret. This is, in fact, the standard way to do it.

What Laravel Passport does by default is not the conventional way, Laravel just tried to make life simpler by combining OAuth server and client in one package :)

In any case, Lumen doesn't have sessions (on purpose) so /authorize links don't belong there, naturally.