Authentication from server!


How can i create authentication users,using Laravel Api ?


Me too I’m using Laravel and Ionic, someone idea ?


Authentication works always the same no matter what backend you use. You need to have API routes for:

  • sign up
  • sign in
  • sign out
  • delete account

as a bare minimum I’d say.

The difference with web applications is that the authentication in the backend is stateless (no session). You generally use a stateless authentication protocol such as JWT. When the client logs in, the backend generates a token with a secret key and sends it back to the client. When the client makes any further request on authenticated routes, it needs to send along the JWT token in a predefined header (such as Authorization). The backend decodes the token, verifies that it was generated by itself, and if so, let the request go through.

I am sure there are existing JWT packages for Laravel :wink: