Redeem Now
Read More
Read now
Menu Close
    Start a Project Request quote Reading list Switch to dark mode

    How to Match Customer Password in Magento 2

    In this blog, we will see how can we check if customer password is a match.
    We can use the below code to check this,

    We can use Magento\Customer\Api\AccountManagementInterface and call the authenticate method which requires two parameters. First param is Email ID of the customer and the second param is the Password. It will return customer data model if it matches otherwise it will throw exception. So we have to write it in try-catch block.

    If you are looking for a way to change customer password programmatically then check out our blog “Change Customer Password Programmatically in Magento2

    Please comment if you face any issue or if there is any confusion. Thanks for checking out the blog.

    P.S. Please do not use Object Manager.

    . . .

    Leave a Comment

    Your email address will not be published. Required fields are marked*

    Be the first to comment.

    Back to Top
    Hire Us!
    Brief us about your requirements and we'll get back to you.
    Woo! Hooy!
    We have just recieved your project brief and our expert will contact you shortly.
    Send Again