i2Rest Anonymous Sessions

From i2Rest
Jump to: navigation, search

Anonymous Sessions

Anonymous sessions are sessions that start according to the settings of *ANONYMOUS Session System.

These sessions are used to serve anonymous requests - requests to run_program APIs that does not have to be authenticated and when the client is trying to call these APIs without OAuth2 authentication token.

i2Rest Server automatically starts anonymous_min anonymous sessions on startup.

All anonymous sessions start with name and authority of anonymous_user - it will be substituted instead of ${user} value in submit command. Value of ${uid} will be generated automatically as a random uuid string.

Upon receive anonymous request, i2Rest Server will route it to first available anonymous session. If all anonymous sessions are busy, i2Rest will start new anonymous session, but not more than anonymous_max sessions. In case of anonymous_max sessions submitted, and no one is available, i2Rest will respond to the client with error message 400 Server is busy.

i2Rest Server uses prestarting mechanism, i.e. it will submit new anonymous session in advance, when it found that some API call will occupy last non-busy anonymous session.

Submitted anonymous session will end automatically after period of inactivity greater than client_timeout parameter of Sessions gate. The restriction on the minimum number of anonymous sessions is taken to account. i2Rest Server will keep as minimum as anonymous_min anonymous sessions alive.