Page 1 of 1

Active Sessions Route

PostPosted: Tue Jun 16, 2026 1:22 pm
by SBarnes
Is there a route on the api that will provide a list of active sessions?

Re: Active Sessions Route

PostPosted: Tue Jun 16, 2026 1:32 pm
by Mike.Sheen
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; }
}

Re: Active Sessions Route

PostPosted: Tue Jun 16, 2026 2:01 pm
by SBarnes
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?

Re: Active Sessions Route

PostPosted: Tue Jun 16, 2026 2:08 pm
by Mike.Sheen
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.