Login Requirements

from the CommonsWare Community archives

At April 20, 2020, 3:56pm, Pvr asked:

Hello
While making Login functionality to my app,
I want to know the procedure of accessing the data like username , password from server .


At April 20, 2020, 4:12pm, mmurphy replied:

I cannot really answer that. You would need to talk to whoever maintains the server and ask that person how to implement authentication and anything else (e.g., user registration).

Note that, in general, you do not retrieve the password from the server. The server ideally does not have the password, but rather saves a securely hashed form of it in its database (see bcrypt and scrypt for common password hash implementations). The client sends over the credentials, and the server compares a hashed version of the user-supplied passphrase with the hashed version stored in the database.


At April 20, 2020, 4:52pm, Pvr replied:

Okay,
After user enters credentials , how to perform credential check on Android( I mean some kind of request must go to server , that request how to do on Android)


At April 20, 2020, 5:15pm, mmurphy replied:

Again, you will need to talk to whoever is maintaining the server and ask that question. I cannot tell you if your server is using REST or GraphQL or websockets or XMPP or IMAP4 or what.

Once you determine how the server maintainer wants you to authenticate the user against the server, you can try to find a client API that will help you implement that. If the server uses REST, you might use Retrofit. If the server uses GraphQL, you might use Apollo-Android. And so on.