sessionstorage

Download Spec

get /auth/api/v1/sessionstorage/users/{user_id}/sessions

Fetch valid user sessions.

offset

int

Offset from which to start fetching objects

Default
0

limit

int

Maximum number of objects to return

Default
50

sortdir

string

Sorting direction

Default
"ASC"
Enum
  • ASC
  • DESC

sortkey

string

Sorting key

Default
"expires"
Enum
  • session_id
  • user_id
  • source_id
  • domain
  • username
  • remote_address
  • user_agent
  • created
  • updated
  • token_expires
  • expires

Response

ExamplesSchema

Successful response, returns valid user sessions.

{
  "count": 1,
  "items": [
    {
      "session_id": "5bf77342-221c-11ee-be56-0242ac120002",
      "user_id": "5bf77342-221c-11ee-be56-0242ac120002",
      "source_id": "5bf77342-221c-11ee-be56-0242ac120002",
      "domain": "privx-ui",
      "username": "alice",
      "remote_addr": "127.0.0.1",
      "user_agent": "Mozilla....",
      "type": "login",
      "created": "2022-01-01T09:17:16Z",
      "updated": "2022-01-01T09:17:16Z",
      "expires": "2022-01-01T09:17:16Z",
      "token_expires": "2022-01-01T09:17:16Z",
      "logged_out": false,
      "current": false
    }
  ]
}

get /auth/api/v1/sessionstorage/users/current/sessions

Fetch current users valid sessions.

offset

int

Offset from which to start fetching objects

Default
0

limit

int

Maximum number of objects to return

Default
50

sortdir

string

Sorting direction

Default
"ASC"
Enum
  • ASC
  • DESC

sortkey

string

Sorting key

Default
"expires"
Enum
  • session_id
  • user_id
  • source_id
  • domain
  • username
  • remote_address
  • user_agent
  • created
  • updated
  • token_expires
  • expires

Response

ExamplesSchema

Successful response, returns current users valid sessions.

{
  "count": 1,
  "items": [
    {
      "session_id": "5bf77342-221c-11ee-be56-0242ac120002",
      "user_id": "5bf77342-221c-11ee-be56-0242ac120002",
      "source_id": "5bf77342-221c-11ee-be56-0242ac120002",
      "domain": "privx-ui",
      "username": "alice",
      "remote_addr": "127.0.0.1",
      "user_agent": "Mozilla....",
      "type": "login",
      "created": "2022-01-01T09:17:16Z",
      "updated": "2022-01-01T09:17:16Z",
      "expires": "2022-01-01T09:17:16Z",
      "token_expires": "2022-01-01T09:17:16Z",
      "logged_out": false,
      "current": false
    }
  ]
}

get /auth/api/v1/sessionstorage/sources/{source_id}/sessions

Fetch valid source sessions.

offset

int

Offset from which to start fetching objects

Default
0

limit

int

Maximum number of objects to return

Default
50

sortdir

string

Sorting direction

Default
"ASC"
Enum
  • ASC
  • DESC

sortkey

string

Sorting key

Default
"expires"
Enum
  • session_id
  • user_id
  • source_id
  • domain
  • username
  • remote_address
  • user_agent
  • created
  • updated
  • token_expires
  • expires

Response

ExamplesSchema

Successful response, returns current users valid sessions.

{
  "count": 1,
  "items": [
    {
      "session_id": "5bf77342-221c-11ee-be56-0242ac120002",
      "user_id": "5bf77342-221c-11ee-be56-0242ac120002",
      "source_id": "5bf77342-221c-11ee-be56-0242ac120002",
      "domain": "privx-ui",
      "username": "alice",
      "remote_addr": "127.0.0.1",
      "user_agent": "Mozilla....",
      "type": "login",
      "created": "2022-01-01T09:17:16Z",
      "updated": "2022-01-01T09:17:16Z",
      "expires": "2022-01-01T09:17:16Z",
      "token_expires": "2022-01-01T09:17:16Z",
      "logged_out": false,
      "current": false
    }
  ]
}

post /auth/api/v1/sessionstorage/sessions/search

Search for sessions

keywords

string

Keywords string which is separated by a comma

Example
"alice, 127.0.0.1, Mozilla/3.0"

user_id

string

uuid

The ID of the user the sessions belong to

type

string

Type of session, login or sso

Example
"login"

Request

{
  "keywords": "alice, 127.0.0.1, Mozilla/3.0",
  "user_id": "5bf77342-221c-11ee-be56-0242ac120002",
  "type": "login"
}

Response

ExamplesSchema

Successful response, returns valid sessions.

{
  "count": 1,
  "items": [
    {
      "session_id": "5bf77342-221c-11ee-be56-0242ac120002",
      "user_id": "5bf77342-221c-11ee-be56-0242ac120002",
      "source_id": "5bf77342-221c-11ee-be56-0242ac120002",
      "domain": "privx-ui",
      "username": "alice",
      "remote_addr": "127.0.0.1",
      "user_agent": "Mozilla....",
      "type": "login",
      "created": "2022-01-01T09:17:16Z",
      "updated": "2022-01-01T09:17:16Z",
      "expires": "2022-01-01T09:17:16Z",
      "token_expires": "2022-01-01T09:17:16Z",
      "logged_out": false,
      "current": false
    }
  ]
}

post /auth/api/v1/sessionstorage/sessions/{session_id}/terminate

Terminate signle session by ID

session_id

string

uuid

required

Session ID

Response

ExamplesSchema

Successful response.

Empty response

post /auth/api/v1/sessionstorage/users/{user_id}/sessions/terminate

Terminate all user sessions

user_id

string

uuid

required

User ID

Response

ExamplesSchema

Successful response.

Empty response

post /auth/api/v1/sessionstorage/users/current/sessions/{session_id}/terminate

Terminate currents user session by ID

session_id

string

uuid

required

Session ID

Response

ExamplesSchema

Successful response.

Empty response

post /auth/api/v1/sessionstorage/users/current/sessionpassword

Get session password

OAuth2 oauth

Required Scopes:

user

Get session password

All Scopes

  • admin · Admin scope - used for built-in SSH PrivX admin account
  • service · Microservice scope - used for communication between SSH PrivX microservices
  • user · Normal users
  • usersManage · Clients with users-manage scope
  • usersView · Clients with users-view scope
Flow Type:
authorization_code
Auth URL:
https://api.x.com/v1/auth/auth
Token URL:
https://api.x.com/v1/auth/auth

Response

ExamplesSchema

Successful response.

{
  "password": "y~X4x4P%F)="
}

Was this page helpful?