0
votes

I want to know if there is any way to check session expiry in client app when it is launched (or when app resumes).

At present I am making use of securing each adapter procedure with a securityTest, so that when the app resumes and user tries to click and make call to server, it throws auth challenge and show login screen. This will get response of the procedure call made on successful authentication.

But I need the app just to show login screen, when the session expires and begin the app from the start. Is there any way without making use of adapter level authentication?

1

1 Answers

0
votes

Have you tried securing the application on the environment level? That is, provide a security test on the environment node in the application-descriptor.xml file.

Then, when the app launches you'll call WL.Client.connect and trigger an authentication flow. This will also generate a session between the client and server.

When that session expires due to inactivity for the set amount of time that you have declared in the worklight.properties file, and you'll do some adapter request - the server will notice that the session has expired and will request authentication again.