I want to create a new Laravel project with Laravel Passport.
I was looking for the controller and the APIs for auth (login/ logout/ register/ forgot password)
if I wanted to use normal auth I would go with Laravel Breeeze but I just need apis.
does any body know any package?
Related
I'm using api in a laravel project
and this project contains multiple laravel apps
one of these apps called auth which is responsible of authentication in other apps
me want to request form another apps to this app for login and authorize users
and i'm using livewire and jetstream in auth app and guzzle php package in another apps for api requests
however i need to use fortify function for login when request receive from another apps
but i dont know this function is exist or i have to create this function and what the way for this work?
if you know a better way, let me know , thank you
i need help in laravel api i want to make api in laravel and i am making api in laravel using auth . means i make api using simple auth without and token .i am just doing simple login and then maintain auth for api and web both side . so what i have to do in this case . i am confuse in between auth and token(through jwt) based api which is better and secure. and which i have to work on.and for auth i am not generate any api token for dashboard apis.
Me and my friend are creating an application. I'm using Laravel 5.4 as the backend and he uses Angular2 as frontend.
The Laravel project serves as a rest API with JWTauth token authentication.
Now I would like to make a small backend dashboard in the Laravel project that is only accessible by admins.
How would I go about using different authentication (with session) instead of tokens when I just browse to the api backend part?
This is pretty straightforward. Just apply the JWT auth middleware to the API routes and the normal auth middleware to your admin dashboard. You don't even need to tweak anything since JWT doesn't need changes to your table structure or need for changing the existing auth.
Build the backend dashboard using the built int auth scaffolding using the auth and guest middleware. For the api routes use the standard api middleware along with the jwt.auth middleware if you're using the tymondesigns/jwt-auth package. There will be no conflict with these two.
Bro use separate guard like
$loginUser = Auth::guard('web')->loginUsingId(12,true);
I know passport uses oAuth, but my question is.. is it better to use Passport for Auth (Login and Register) or should i use jwt for login and register and Passport for external API requests... or use passport for both (User API and Login/AUTH)
Now i'm programming a SPA website with laravel and VueJs 2, i'm stuck in this.
Laravel Passport does, in fact, use JWT so comparing "JWT vs Passport" is kind of wrong.
You can use Laravel Passport for everything you mentioned - logging in, registering (not built-in in Passport but easy to add) and protecting external API requests.
please help me,
I want the stateless authentication for Rest api for login api to to get the token from it by using guard in it.
You might consider using Laravel Lumen because laravel by default uses session state.
In lumen you can be able to authenticate a user by using the new Auth::viaRequest() method. Docs here: https://lumen.laravel.com/docs/5.2/authentication