in one of our tenant we are using custom database in Authentication for our application in that for login page we have written the code for the to login using email or username. when the user uses the email for the login its working fine but when the same user try to go through his user name its showing that invalid email,user,password.
we are using the below query. we are using tedious library in my code
console.log(email,“Email”);
const query = ‘SELECT Id, UserName, Email, PasswordHash FROM dbo.AspNetUsers WHERE Email = @Email or UserName = @Email’;
const query1 = ‘SELECT ClaimType, ClaimValue FROM dbo.AspNetUserClaims WHERE UserId = @UserId and (ClaimType=@Idr or ClaimType=@Idc or ClaimType=@Ecode)’;
we have tried to add the user parameter in the login code and console logs for errors
when we have checked the logs the data for the user is there but the user is still unable to access the application through the username
I suggest checking your tenant logs to see what is the source of the issue for the failed login.
It might also be worth using the Real-time Webtask Logs Extension to debug your custom database action scripts. You should be able to find clues as to why the login failed with the username and not with email.
Hi, @rueben.tiow
Based on the above information, at script no issue was found. i am getting the issue “returned profile does not contain specified identifying attribute” when i verify login and try on the custom DB function.
Hi, @rueben.tiow
Based on the above information, at script no issue was found. i am getting the issue “returned profile does not contain specified identifying attribute” when i verify login and try on the custom DB function.
You might need to review the user profile in the callback URL to include the idr, idc, and ecode properties in the user_metadata or app_metadata if they represent non-identifying attributes.