I'm trying to do a mobile app which will talk to the backend server based on laravel frame to perform CRUD operations.
however, i also need to authenticate users before they're allowed to perform such operations
also, I need their user ID by calling Auth::user()->id to keep track of the operations they have done so far
so my question is, should I just use Auth::check() to check if the user is login, or should I use other tools like Oauth2 to do that? from my understanding, rest is stateless and therefore it won't store anything inside the session, so I not sure if Auth::check works if there are multiple users using. Right now there's only one tester for the mobile counterpart so I can't be sure whether the auth::check() could be independent of the users
if oauth, which one would you guys recommend?
Hi,
If I were you, I'd use access token.. and store them in a database. I already implemented something similar. You can have a look on the starter restful API I made with Laravel (Token class): https://github.com/merlosy/laravel-restful-api-starter
Regards,
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community