Login#
HTTP session management#
MXCuBE web sessions are meant to expire when there is no activity.
For this purpose:
Flask configuration setting
PERMANENT_SESSION_LIFETIMEis set to the preferred value (seconds).Flask configuration setting
SESSION_REFRESH_EACH_REQUESTis enabled, which is the default anyway.Flask session setting
session.permanentis set right after successful authentication.The front-end calls the
/mxcube/api/v0.1/login/refresh_sessionendpoint regularly (interval is specified inserver.yaml, default to 9000 milliseconds ) for as long as the browser tab is open.
Every time the refresh endpoint is called,
the browser session cookie is refreshed,
meaning its expiration timestamp is pushed back in the future
for as much as the value stored in PERMANENT_SESSION_LIFETIME.
Testing with ISPyBMockupClient#
ISPyBMockupClient simulates both user type and proposal type login. The
typical demo/test configuration can be found below. The loginType attribute
is used to switch between the two different behaviours, user for user type
login and proposal for proposal type login.
<object class="ISPyBClientMockup">
<object hwrid="/lims_rest" role="lims_rest"/>
<ws_root>
https://your.lims.org
</ws_root>
<base_result_url>
https://your.limsresults.org
</base_result_url>
<ws_username></ws_username>
<ws_password></ws_password>
<loginType>user</loginType> <!-- set to user or proposal -->
<object role="session" href="/session"/>
</object>
Example test configuration