On this page

No Password Login

Description

No Password Login extension enables customers to securely log in, register, and checkout without a password. Customers can now create an account and log in to the website with just a single click which they get in their email. The module removes the necessity of remembering passwords to access or create an account on the website.

Module Demo

Compatibility

No Password Login module is compatible with the following Magento platforms:

Community Edition (Open Source) Enterprise Edition (Commerce) Cloud Edition
2.3.0 - 2.4.* 2.3.0 - 2.4.* 2.3.0 - 2.4.*

Installation

Installing module using zip file

  • Unzip and paste the extension file into your root Magento folder.
  • Connect to your server by SSH.
  • Go to your Magento root folder.
  • To install the extension, perform this command:
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy

Composer installation

If you haven't installed any Aitoc module before, in that case first you will need to add your Aitoc composer repository. Please go through the document to see how you can add composer repository.

To install the module, you will need to run following commands:

composer require aitoc/module-login
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
  • To switch the extension on/off, perform these commands:
php bin/magento module:enable Aitoc_Login
php bin/magento module:disable Aitoc_Login
  • To update the module, use below command:
composer update aitoc/module-login

Version Compatibility

No Password Login is compatible with the following Magento platforms:

Community Edition (Open Source) Enterprise Edition (Commerce) Cloud Edition
2.3.0 - 2.4.* 2.3.0 - 2.4.* 2.3.0 - 2.4.*

Module Configuration

To access the configuration of the module, select Stores → Configuration → AITOC EXTENSIONS → No Password Login from within the admin panel.

No Password Login

Also, you can go to Admin → AITOC → No Password Login → Configuration to access module configuration:

No Password Login

On this workspace you'll find 3 tabs.

General

No Password Login

Operational Mode

Using this configuration field, you can define how the module functionality should work on the front end for customers. There are three options that you can select from:

Disable: If Disable option has been selected, that means the module functionality is disabled, and it won't work.

Enabled (Full): When this option is selected, on the front end, customer sign-in and sign-up will be done by a link they will receive in an email. There won't be any option for the user to enter a password on the account creation or Sign in Page. Once customers enter their email address and click the "Send login link" button, they will receive an email on the entered email address. The email will have a link for customers to log in to their accounts.

Enabled (Optional): When this option is selected, the customer can sign-up, sign-in using both: an email address and password, as well as, log in via email using the module functionality.

Limit logins to existing customers

This configuration option restricts the module functionality to existing customers only.

If "Yes" is selected, only existing customers can log into the site using the module functionality. When anybody tries to log into the site where the email address does not belong to an existing customer, they will receive the message "Sorry, but you do not have an account on this website."

No Password Login

The admin can update the message using the Non-customer login error message field. This field only appears when "Limit logins to existing customers = Yes" is selected.

No Password Login

Sign In Settings

No Password Login

The Token Expires In field determines the minutes after which the Sign In link, which is sent to the customer, expires. By default, the value is set to 10 minutes. You can edit and add numeric values here.

The Email Sender field selects the email's sender for Sign Up/Sign In emails.

You can add/edit the email address and sender name value from Stores → Configuration → General → Store Email Address:

No Password Login

The Sign In (to existing account) configuration provides the email template you want the customer to receive.

The template used here is when a login attempt with an email address already exists as a customer in Magento.

After installation, the module will create an email template used in this field called OTP Sign In (Existing Account) by default. But you can change the email template and set it as new. Please refer to this section of the manual

The exact configuration is provided for the Sign In (to non-existing account) scenario. The backend administrator can specify the template to be used when an email address does not exist as a customer. The default template is named OTP Sign In (New Account).

Sign Up Settings

No Password Login

The Token Expires In setting determines the minutes after which the Sign-Up link sent to the customer expires. By default, the value is set to 20 minutes. You can edit and add numeric values here.

Default Welcome Email

After the Basic Configuration of the extension is finished, you'll also need to update the email template set for New Account. This can be achieved by changing the value for Default Welcome Email Without Password field to New Account Without Password (OTP).

To do this, please go to Stores → Configuration → Customers → Customer Configuration → Create New Account Options → Default Welcome Email Without Password:

No Password Login

Security

We strongly advise that you also set the Require Emails Confirmation to Yes. If this is set to No, a user can enter any valid email address that is not a customer and be immediately logged into the site (potentially placing an order). If this is set to Yes, it further enforces a login step via email, validating that the user has proper access to the email address. You can change this setting from Stores > Configuration > Customer > Customer Configuration > Create Account Option > Require Email Confirmation = Yes. No Password Login

Customer Journey

If the module is enabled, then on the front-end, the user can create an account and access the site without entering or remembering the password.

Customer Signup

When the user clicks the "Create Account" link on the frontend, a form will appear without any password fields:

No Password Login

The user must enter the required details and click the Create an Account button. Once this is done, the user will receive an email:

No Password Login

In the received email, there will be a link. Once the user clicks that link/button, they will be redirected to the site as a registered customer, and the user will be logged in. There won't be any need to enter a password.

Token Expiration

By default, the signup link will get expired after 20 min. This can be changed extension's configuration.

Customer Sign In

When the user clicks the "Sign In" link on the frontend, a form will appear without any password fields:

No Password Login

In the received email, there will be a link. Once the user clicks that link/button, they will be redirected to the site as a logged-in customer, and My Account Dashboard page will appear:

No Password Login

Suppose the entered email address does not match any existing customer record. The user will receive a link to Activate their account in that case. Then they can create their account as mentioned [here] (#customer-signup).

Token Expiration

By default, the sign in link will expire after 10 min. This can be changed extension's configuration

Email Templates Customization

To customize the email templates from the defaults installed, go to Marketing → Communications → Email Templates. Now click on the Add New Template button.

Select one of the default templates this extension uses in the Template drop-down.

No Password Login
  • New Account Without Password (OTP) is used when a new account is created (assuming you have configured this as per the Email Template update in Customer Configuration above)
  • OTP Sign In (Existing Account) is used when a login request is made using an email address that already exists as a customer.
  • OTP Sign In (New Account) is used when a login request is made using an email address that does not exist as a customer.

These templates contain specific content that must be used to ensure links are generated correctly in the emails. These are as follows:

New Account Without Password (OTP)

The following code should be used to generate the link that enables the customer to complete their account registration.

{{trans
   'Thanks for signing up — click the link to be automatically signed in: <a href="%token_url">Sign in</a>'
   token_url="$this.getUrl($store,'customer/otp/auth/',[_query:[token:$customer.login_token.create().token],_nosid:1])"
   |raw}}

OTP Sign In (Existing Account) / OTP Sign In (New Account)

Notice the use of the $tokenUrl variable .

{{trans
       'Thanks for signing up — use this link to complete the sign up process and be automatically signed in: <a href="%token_url">Activate My Account</a>'

       token_url=$tokenUrl
   |raw}}

For more information regarding editing email templates, please visit the Magento guide.

Developer API

An API provides a way for the Magento solution and technical partners to utilize our tokenization system to generate secure login links and validate the links as customers arrive back to the site from an email link.

Client side API

AuthenticationManagementInterface API provides methods like:

  • createToken to create a token from the customer email and return a TokenInterface
  • The TokenInterface can then be used with tokenizeUrl method to generate a secure login link (string), which can be sent to the customer via email.
  • Optionally sendOtp could be utilized for a whole login experience (create token + generated link + send email) and redirect the customer to a custom (next) URL eventually.

TokenRepositoryInterface API provides methods like getCustomerTokens and getActiveToken, providing an easy way to add validation to your custom controllers.

Server side API

A REST API is available for those developers who want to generate a login URL from an external platform. If the generated URL is then presented to the user and they follow it, they will be logged into Magento.

Required parameters to create a token:

  • Customer email
  • Store ID
  • Token expiry (in minutes)

Create token request

Method: POST REST URL: /rest/V1/otp/createToken Request payload (JSON):

{
  "email":"[email protected]",
  "storeId":"1",
  "expiry":5
}
Response payload (JSON):
{
    "token": "CTT2O77ujldPOC23ofhfA2OQzXOL9Jy1",
    "email": "[email protected]",
    "website_id": 1,
    "website": {
        "id": 1,
        "code": "base",
        "name": "Main Website",
        "default_group_id": 1
    },
    "customer_id": null,
    "expires_at": "2023-06-03 04:35:34",
    "store_id": 1
}

The token value can be taken from the response payload and used to create the URL that points to OTP auth controller, like:

URL: https://<host>/customer/otp/auth/token/<token>/

Create tokenised authentication URL

If URL generation is not possible manually, then OTP API can be used to create the URL as well. That is mostly useful for websites with multiple stores.

Method: POST REST URL: /rest/V1/otp/createUrl Request payload (JSON):

{
  "path":"customer/otp/auth",
  "token":
  {
    "token": "YreRTqil9qAiFvMcTa6OGFllahtOGsoF",
    "email": "[email protected]",
    "website_id": 1,
    "website": {
        "id": 1,
        "code": "base",
        "name": "Main Website",
        "default_group_id": 1
    },
    "customer_id": null,
    "expires_at": "2023-06-03 04:26:39",
    "store_id": 1
}
}
Please note that is the exact response value from Create token request.

Response payload (string):

https://my.magento.site/customer/otp/auth/token/xxxxxxxxxxxx/

Send Email

Method: POST REST URL: /rest/V1/otp/sendEmail Request payload (JSON):

{
    "email": "[email protected]",
    "storeId": 1
}
By sending the above request, an email to [email protected] with login link will send.

THANK YOU FOR CHOOSING AITOC EXTENSIONS!