I want a user to login using a registered email id or phone number(a provision for both) instead of username. How can this be done using the built in user_login provided by outsystems?
And if not possible by user_login, what are the alternatives?
I am attaching an image for more clarity on the use case.
Hi Amol,
The alternate way is
Based on Email ID and Phone number you can get user name from User Entity and pass username and password in built in user_login provided by outsystems.
you need to add only one aggregate and add filter based on email and mobile number before doLogin Action.
Hope this will help you.
Regards
Rahul
You'd have to modify the Login screen action of the Login screen to:
Note: This assumes that both the phone number as well as the username/email are unique.
This way you don't have to worry about the details of checking the password before using the System's Login action, you can still rely on the Users' implementation of User_Login to do that for you.
There is a built-in action in System module to login a user using its User Identifier.
Before using this, you can first check the email and phone number if it exist in User Entity. If it exist, use the User Identifier of the existing record as an input parameter for the Login Server Action.
Also, to validate the entered password, you can use the ValidatePassword of PlatformPasswordUtils to check if the entered password is same with the stored password in User Entity
Hope this helps,
Thanks for the answers.
All the three solutions work!