Instagram

About Me

Photo Profile
Meetanshi Architecture Designer

Meetanshi is found based on providing the best Magento Extensions and Customized eCommerce Business Solutions perfected to the users’ needs. Our Happy users make us Happy. Complete satisfaction to our clients is what drives and motivates us to work hard. Read More

Thursday, April 20, 2023

Magento 2 API – Generate Customer Token Using Customer ID

Greetings, Magento developers! Today, I have a module to share with you that allows for the Create a customer token by using the customer ID from Magento 2 API. This module is particularly useful if you are developing an app using Magento 2 and need to regenerate customer tokens from the admin side.


Here's the backstory:

One day, a colleague asked me if there was a way to generate customer tokens using their ID through the Magento 2 API. He was working on an Android app and needed to keep the customer's session active based on their activity. The obvious solution was to increase the token expiration time to infinity, but that wasn't practical from a security perspective.

So, we decided to develop a custom Magento 2 REST API that could be used to regenerate the token before it expires and keep the session active.

In this post, I'll share the entire module for the custom API and explain how to use it.

For more information, please visit this:- https://meetanshi.com/blog/magento-2-api-generate-customer-token-using-customer-id/

No comments:
Write comments


Get more of our update !