hello !
I'm new to Laravel and I'm building a website where i store users password using bcrypt in MySql Database.
now i have an android app should connect to the same DB and authenticate users email address and password.
so i need your help with below 2 points please :)
1- initially for now im using a simple php webservice to authenticate users for demo purposes only. but I can't check the Password as its encrypted in the DB . so how can i check it.
2-later on im planning to use (Laravel API authentication (passport)) to build the the web-services (any comments regarding passport or using other way will be appreciated) and im guessing it will overcome the bcrypt issue , but my concern is when sending the password from android to the API , i don't like sending it as a plain text , so how to over come this please :)
To check the hashed password in your database with user input password try this
$hashedPassword= // take the password column from user table using email address
if (Hash::check($request->input('password'), $hashedPassword))
{
// The passwords match...
}else{
// Password don't match
}
While using passport you will be using oauth type authentication to login into your app so it's already secure way to authenticate and authorize.