Creating and Consuming a REST API

-1

Good morning, I'm trying to create an API, to do a user validation and password, to use in xamarin. But I am in doubt, if I want to fetch a user x and a password x in the database should I pass all users and passwords to a site or is there any way to only perform the user query x and that x password and just return those dynamically? I'm sorry if the question was a bit vague, but my doubt is in the logic, I'm not understanding very well with the API will communicate dynamically with the database.

    
asked by anonymous 04.10.2018 / 19:26

2 answers

0

Using an API:

  • Mobile : sends the login attempt (login and password) data to the API
  • API : performs the query in the database to check if there is an entry for user and password informed ( SELECT * FROM user u WHERE u.login = '[login enviado]' AND u.senha='[senha digitada]' . Will return the query result (if there was a result)
  • Mobile : Displays the result of the attempt (whether or not the user with the password exists in the database)
  • 11.10.2018 / 15:34
    0

    Hello, my suggestion is that you create a Rest Full api, apply some security rules like encrypt the data sent by saving the keys in the app and in the REST server, on security if the restfull API is well developed it is safe yes. It is currently one of the best ways to communicate applications with DBs.

        
    04.10.2018 / 22:01