Active Sessions Route

Discussions relating to the REST API of Jiwa 7.

Active Sessions Route

Postby SBarnes » Tue Jun 16, 2026 1:22 pm

Is there a route on the api that will provide a list of active sessions?
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1709
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 191

Re: Active Sessions Route

Postby Mike.Sheen » Tue Jun 16, 2026 1:32 pm

Version 7 it's GET /Staff/Current/List (StaffCurrentUserListGETRequest) which returns List<StaffCurrentUserGETResponse>, where StaffCurrentUserGETResponse is defined as:

Code: Select all
public class StaffCurrentUserGETResponse
{
   public string SessionID { get; set; }
   public string IPAddress { get; set; }
   public string Username { get; set; }
   public string StaffID { get; set; }
   public DateTime LoginDateTime { get; set; }
   public int DurationDays { get; set; }
   public int DurationHours { get; set; }
   public int DurationMinutes { get; set; }
   public int DurationSeconds { get; set; }
   public long RequestCount { get; set; }
   public long ConcurrentRequestCount { get; set; }
   public long MaxConcurrentRequestCount { get; set; }
}


In version 8 we cleaned some things up and made names more consistent / sensible, so we removed /Staff/Current/List and instead have GET /Sessions (AuthSessionsGETRequest) as a replacement which returns an List<JiwaAuthUserSessionResponse>, where JiwaAuthUserSessionResponse is defined as:

Code: Select all
public class JiwaAuthUserSessionResponse
{
   public string Id { get; set; }
   public string AuthProvider { get; set; }
   public DateTime CreatedAt { get; set; }
   public string UserName { get; set; }
   public string DisplayName { get; set; }
   public string APIKey_Type { get; set; }
   public string PrincipalID { get; set; }
   public string JiwaStaffID { get; set; }      
   public string JiwaStaffUsername { get; set; }
   public string JiwaStaffTitle { get; set; }
   public string JiwaStaffFirstname { get; set; }
   public string JiwaStaffSurname { get; set; }
   public string JiwaStaffEmailAddress { get; set; }
   public byte[] JiwaStaffPicture { get; set; }
   public string DebtorContactNameID { get; set; }
   public string DebtorContactNameTitle { get; set; }
   public string DebtorContactNameFirstName { get; set; }
   public string DebtorContactNameSurname { get; set; }
   public string DebtorContactNameEmailAddress { get; set; }
   public string DebtorID { get; set; }
   public string DebtorName { get; set; }
   
   [IgnoreDataMember]
   public HashSet<string> AllowedRoutePermissions { get; set; }
}
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2608
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 818

Re: Active Sessions Route

Postby SBarnes » Tue Jun 16, 2026 2:01 pm

Thanks Mike,

My reason for asking is a customer is getting compile errors on plugins when trying to login using auth not api key, could there be the posssiblity that if the same user tries to login multiple times before the compiles have completed and the session assigned that this could cause file locks under version 7 SR20?
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1709
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 191

Re: Active Sessions Route

Postby Mike.Sheen » Tue Jun 16, 2026 2:08 pm

SBarnes wrote:could there be the posssiblity that if the same user tries to login multiple times before the compiles have completed and the session assigned that this could cause file locks under version 7 SR20?


It's a possibility, but unlikely - would only happen if a plugin has changed after someone else had logged in and has got a current session active, and then the same user tried to login again - the 1st session would have loaded plugin assemblies into the app domain, and the 2nd login is then trying to write the compiled plugin dll to the %ProgramData%\Jiwa Financials... folder - but like I said that only happens when plugins change, and just getting them to log out of all sessions will resolve the issue.

Another test you can try is deleting that users %ProgramData%\Jiwa Financials\... folder - if any of the plugin dll's in there are currently loaded it'll prevent you from deleting them.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2608
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 818


Return to REST API

Who is online

Users browsing this forum: No registered users and 1 guest