dimanche 22 mai 2016

Token based authentication for API in Laravel 5.2.31

I have two database tables in MySQL.

  1. User Table
  2. Class Table

I have a working code in Laravel 5.2 on localhost, where I can see Class screen only after authentication. So far everything is working fine.

Now, I have to access the list of class, Add/Update Class functions from Android App.

I am thinking to use Token Based authentication. I saw the User table that Laravel provides when we create a new project. We have remember_token in User Table. I was thinking to use same token for Android and for Website.

Here the problem is : Token will be expired if you logout from the website and if I use same token, then expired token can not be used in android requests even if Android has done the authentication already.

Please suggest the correct way to use Token based authentication



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire