I have followed the example as described in post Two-factor authentication and have got the sample app working fine.
I am trying to implement the same logic within my existing project (although changed doLogin(String login, String password, Locale locale) to doLogin(Credentials cred)) and everything seems to work with the exception of the following code within the doLogin function:
ExtUser user = dataManager.load(LoadContext.create(ExtUser.class) .setQuery( new LoadContext.Query("select u from sec$User u where u.loginLowerCase = :login") .setParameter("login", ((LoginPasswordCredentials) cred).getLogin().toLowerCase()) ) .setView(View.LOCAL) );
This always returns a ‘user’ value of null within the ext-login screen. I have tried the code under a different page within the project on a button click and it returns the value as I would have expected. I have also tried a different (working) loadcontext.query for a different entity and this also returns null within the doLogin function of the ext-login screen.
Is there something I am missing with the ext-login screen to enable this query to work.
Thanks in advance