Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

IAM.SESSION.LIST

Last updated
IAM.SESSION.LIST
Group
IAM
Complexity
O(N) where N is the number of sessions
Arity
1 (exactly, counting the command name)
Flags
admin, read-only, fast
HotKV Cloud
Not available
On-Premise
requires the enterprise-iam license feature

IAM.SESSION.LIST returns the sessions open on the node you ask: one for each connection that logged in with IAM.AUTH, or with AUTH as an LDAP user. Sessions belong to their node; a cluster does not copy them. A connection that logged in with plain AUTH as an ACL user, or never logged in, has no session.

An array in RESP2 and RESP3, sorted by session ID, with one flat array of 18 elements (nine names and values) for each session. An empty array if there is none.

Name Value
id The session ID, as an integer. Use it with IAM.SESSION.KILL
username The name the login was made with
source local, ldap or oidc
identity The user the connection runs as, such as ldap:alice#7. This is what ACL WHOAMI, CLIENT LIST and the audit log show. For local it is the ACL user
client The connection’s client ID, as an integer
address The address the connection came from
created When the session began, as a Unix time in seconds
expires When it ends by itself (an OIDC token’s exp) as a Unix time, 0 if it does not
roles The roles it has now, separated by commas; empty for local

Without a license that includes enterprise-iam the reply is the error NOLICENSE enterprise-iam requires a HotKV license. Contact sales@hotkv.com.

127.0.0.1:6379> IAM.SESSION.LIST
1) 1) "id"
2) (integer) 2
3) "username"
4) "erin"
5) "source"
6) "oidc"
7) "identity"
8) "oidc:erin#2"
9) "client"
10) (integer) 44
11) "address"
12) "127.0.0.1"
13) "created"
14) (integer) 1791751673
15) "expires"
16) (integer) 1791755273
17) "roles"
18) "app"

HotKV-only command.

IAM.SESSION.KILL, IAM.AUTH, Roles and single sign-on