Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ahmad.alkaiyat's avatar

check Password Laravel/android

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 :)

many thanks in advanced

0 likes
2 replies
RamjithAp's avatar
  1. 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
}
  1. 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.

Please or to participate in this conversation.