Closed
Description
Since Lumen does not support session state, incoming requests that we wish to authenticate must be authenticated via a stateless mechanism such as API tokens. This package is really going to be helpful for resolving out the authenticated user from the request through API token.
https://lumen.laravel.com/docs/5.2/authentication
Auth::viaRequest('api', function ($request) {
try {
if (! $user = JWTAuth::parseToken()->authenticate()) {
return null;
}
} catch (Exception $e) {
return null;
}
return $user;
});
It would be really helpful if we have another section in the wiki about integrating this package with Lumen. I see that most of the work has already been done ( already there is a LumenServiceProvider ), only that it needs to be upgraded to support v5.2 and documented. Thank you Symon for giving us this wonderful package that we can use with out Laravel and Lumen projects.
Metadata
Metadata
Assignees
Labels
No labels