Creating and Consuming a REST API

Asked

Viewed 115 times

-1

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

2 answers

0

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

0


Using an API:

  1. Mobile:sends login attempt data (login and password) to the API
  2. API: performs the query in the database to verify if there is an input for user and password informed (SELECT * FROM user u WHERE u.login = '[login enviado]' AND u.senha='[senha digitada]' . Return the result of the query (whether or not there was a result)
  3. Mobile: displays the result of the attempt (whether or not the user with the password exists in the database)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.