I have encountered incorrect behavior of security.authenticate() which always returns null in developer irrespective of credentials are valid or not.
Here is my code snippet:
- Code: Select all
function onSolutionOpen(arg, queryParams) {
var loginResult = security.authenticate(["username","password"]);
application.output("Login Result:"+loginResult,LOGGINGLEVEL.INFO);
if(loginResult){
var userName = security.getUserName();
application.output("User name:"+userName,LOGGINGLEVEL.INFO);
}
else
{
application.output("Login failed due to invalid credentials.",LOGGINGLEVEL.INFO);
application.exit();
}
}
Output of above code:
Login Result:
Login failed due to invalid credentials.
Note:
Code is tested for both valid and invalid credentials but same result. and also tested on Servoy 8.2 & Servoy 8.4 but same result.
Any assistance in resolving above will be highly appreciated.
Thanks