Search code examples
laravellaravel-authentication

Laravel 7 Auth password sent in plain text


I have default auth implemented in Laravel 7 and works like a charm. However, I have a very peculiar requirement wherein, the password shouldn't even travel in plain text although SSL is implemented on network. One way would be to handle it via javascript on login page wherein I encrypt the value of password and send the same to server and then decrypt the same in php before handing it to laravel attemptLogin method. However, I am not so sure about this approach. Any help would be awesome.

Solution:

On client side, used crypt.js/aes.min.js and encrypted the password using a key and iv.

In login controller, overrode credentials method and decrypted using openssl_decrypt before passing on to hash check.


Solution

  • I solved it as below:

    On client side, used crypt.js/aes.min.js and encrypted the password using a key and iv.

    In login controller, overrode credentials method and decrypted using openssl_decrypt before passing on to hash check.