I have a remote API that will validate existing customers' credentials and log them into Magento 2 customers' area.

The target flow is the following:

  • Customer visits Magento site
  • Fills in username and password
  • Submit the form
  • Magento will call the API that looks something like this:


  • If the credentials are correct, the API will return a json object with user details. Like email, first name, last name...etc
  • The customer is logged into Magento.

I figured I need a custom module for this, my confusing is:

  • Can I leverage existing Magento login form, or do I need to create my own form + URL + blocks/templates.
  • The custom form will have it's Controller that will do all this logic, or is there a way to hook into existing login controller.
  • I have to create a user in Magento DB as well.

Thanks in advance.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.