0

I have passwords already encrypted in a SQL Server database. When I try to check the password entered in the Laravel app, it doesn't match with the password in the DB. How can I match these passwords? Are they encrypted differently?

NoNaMe
  • 6,020
  • 30
  • 82
  • 110
Jasper VB
  • 31
  • 9
  • I'm guessing they're Hashed passwords. You'd need to take the string entered in the password box and Hash that in the same way to compare they are the same. See: http://laravel.com/docs/5.0/hashing – scgough Jun 12 '15 at 10:23
  • What are you trying to do? This isn't related to SQL Server. Are you trying to use the membership database from an ASP.NET application? You will find various similar questions then, eg [this one](http://stackoverflow.com/questions/17244332/using-php-to-authenticate-users-in-an-asp-net-membership) – Panagiotis Kanavos Jun 12 '15 at 10:27

2 Answers2

0

Insert password field with Hash class and make() method.

Below is an example:

$user->password = Hash::make(Input::get('pswd'));
nyedidikeke
  • 6,899
  • 7
  • 44
  • 59
Juluri Vinay
  • 105
  • 3
  • 14
0

To validate the password entered by the user with the password you have stored in the dB use

if(Hash::check($userentry,$dbentry))
   {
      //if we are under this scope that means supplied password matches with the password in dB 
   }
Khan Shahrukh
  • 6,109
  • 4
  • 33
  • 43