What is the best method to do login authentication in android and webservice php RESTFul?

5

I'm building an application that needs login, I've already created the webservice in php using Slim.

I'm currently using a POST, passing a json with email and password to the webservice to return the corresponding user's json, but I believe that is not the best way.

If you can suggest me a better way using these technologies.

Thank you.

    
asked by anonymous 06.09.2015 / 19:12

1 answer

2

Hello!

In order to do the verification, you can send the credentials of the user as you are doing (it must be https), and as you will use in mobile, I believe it is more appropriate to work with JSON Web Tokens (JWT) for the return!

JWT

You return a token for the user, save this Token, and at every request that the user makes that token go together. This way, you can validate the token on your server and continue with the action if it is valid or simply deny the token because it has already expired or is invalid.

    
04.02.2016 / 12:01