I am using IBM Worklight 6.1 and trying to check if the user is authenticated or not:
I have a Realm defined in server/conf/authenticationConfig.xml
<realm name="myRealm" loginModule="myLoginModule">
<className>com.worklight.integration.auth.AdapterAuthenticator</className>
<parameter name="login-function" value="authentication.onAuthRequired" />
<parameter name="logout-function" value="authentication.onLogout" />
</realm>
and its login module
<loginModule name="myLoginModule">
<className>com.worklight.core.auth.ext.NonValidatingLoginModule</className>
</loginModule>
and after logging in, or even before that, when I try to check if the user is authenticated or not using
WL.Client.isUserAuthenticated("myRealm")
I have the following response
Unknown realm [myRealm]. null returned for key: isUserAuthenticated
Anyone have an idea about that ? Is there something wrong with my Realm definition ? Is there a better way to check if a user is authenticated ?