Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Verify Laravel password hash using C#

Tags:

c#

php

laravel

I have an existing Laravel 4 site that stores user login details in the MySql DB. The password stored as a hash using....

Hash::make()

There is now a new separate site being made that will utilise the same user logins in the same db. This site will be built in C#.

How can I in C# verify a user's login credentials when the password hash in the DB was created using Laravel?

like image 440
MakkyNZ Avatar asked Aug 31 '25 20:08

MakkyNZ


1 Answers

A bit late but this worked for me:

Install package

enter image description here

Then you just import the library in the .cs file

enter image description here

And in a function for example "LOGIN" after making the query to the DB we verify if the passwords are the same as in the image where the first parameter is the password that you enter in the textbox and the other is the one that returns the consult.

enter image description here

I made a query to the DB with the username, You can use the field you want, mail, names, surnames, etc.

Sorry if I'm not very clear, I'm using a translator, I don't speak English, but I want to contribute to the community, even if it's too late, it can help someone like I had to investigate to make this work.

like image 170
DAD Avatar answered Sep 03 '25 08:09

DAD