cancel
Showing results for 
Search instead for 
Did you mean: 

How to allow login using mobile number in b2cstorefront

Former Member
0 Kudos

Hello ,

Currently Hybris support EmailId and password to login into storefront, but as per our requirement we need to allow login using Email Id/Mobile Number as a username into storefront.

can anyone please suggest how can we achieve this requirement.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

HI Kyle,

Thanks for the answer, but i did not find any login controller for that,

i just gone through the code and find out that first time login will be done by spring security " spring-security-config.xml" and i did not understand from where should i wright your code suggest by you?

Thanks, Ankit

Former Member
0 Kudos

This is how I would go about the requirement.

Inside your login controller you would need to differentiate whether the String you were given was an email or phone number. If it is a phone number, you would then run a flexible search to get the email associated with that phone number. Then you would proceed with the login as normal using that email address and the password given from the user.