Session without logout based on IBM Worklight Adapter based authentication

I downloaded an adapter based authentication project from IBM Worklight and found that when I click Log Out, it does not end the current session, but time out. His session ends correctly. (Note that it ends the session but does not delete the UserID.) I have set serverSessionTimeout = 3 in Below are screenshots that will show the whole picture of what is happening:

  • When I click Get Secret, the IBM worklight Console shows DeviceID, Device Model, but not UserID under the Devices tab

Initial screen

  1. Now when I put in the username and password it logs me in and the UserID changes the background color and when I log out nothing changes here. In my code, I added 1 more username worklight1, and when I log in with worklight1 , this screen still shows the highlight in UserID. The UserID only changes after the timeout expires, i.e. after 3 minutes in my case!

Successful login using userID: worklight

  1. After a timeout, if I try to log in with any user, the user ID changes to that particular user and stays that way until the session ends.

After Timeout, logging in with other userID

Can anyone suggest how to end the session, as I tried the following code on logout, but didn't help -

WL.Server.setActiveUser("SingleStepAuthRealm", null);


Thank you Advance!


source to share

1 answer

I just tested the Worklight sample adapter authentication sample and it works as expected. When logged out, the user is logged out. ( )

Are you passing the wrong realm in the logout function?

Take a look at the sample code for exiting a single step application: WL.Client.logout ('SingleStepAuthRealm', {onSuccess: WL.Client.reloadApp})

This code will get you out of SingleStepAuthRealm and not DoubleStepAuthRealm.



All Articles