Skip to content

Get the administrator operation log ​

You can select request ID, client IP, operation type, resource type, administrator user ID, request success, start timestamp, end timestamp, and paging to get the administrator operation log interface

Method name ​

ManagementClient.getAdminAuditLogs

Request parameters ​

NameTypeIs it requiredDefault valueDescriptionSample value
requestIdstringNo-Request IDxxx
clientIpstringNo-Client IPxxx
operationTypestringNo-Operation typecreate
resourceTypestringNo-Resource typeuser
userIdstringNo-Admin user IDxxx
successbooleanNo-Request successtrue
startnumberNo-Start timestamp11
endnumberNo-End timestamp111
pagination<a ListWebhooksDtoNo-Pagination

Sample code ​

ts
import { ManagementClient, Models } from "authing-node-sdk";

// Initialization ManagementClient
const managementClient = new ManagementClient({
  // Need to be replaced with your GenAuth Access Key ID
  accessKeyId: "GEN_AUTH_ACCESS_KEY_ID",
  // Need to be replaced with your GenAuth Access Key Secret
  accessKeySecret: "GEN_AUTH_ACCESS_KEY_SECRET",
  // If it is a private deployment customer, you need to set the GenAuth service domain name
  // host: 'https://api.your-authing-service.com'
});

(async () => {
  const result = await managementClient.getAdminAuditLogs({
    requestId: "requestId",
    operationType: "create",
    userId: "userId1",
    resourceType: "user",
    success: true,
    pagination: {
      page: 1,
      limit: 10,
    },
  });

  console.log(JSON.stringify(result, null, 2));
})();

Request response ​

Type: AdminAuditLogRespDto

NameTypeDescription
statusCodenumberBusiness status code, which can be used to determine whether the operation is successful. 200 means success.
messagestringDescription
apiCodenumberSegmented error code, which can be used to get the specific error type.
requestIdstringRequest ID. Returned when the request fails.
data<a AdminAuditLogRespDataResponse data

Sample result:

json
{
  "statusCode": 200,
  "message": "Operation successful",
  "requestId": "934108e5-9fbf-4d24-8da1-c330328abd6c",
  "data": {
    "totalCount": 1,
    "list": {
      "adminUserId": "xxx",
      "adminUserAvatar": "https://files.authing.co/authing-console/default-app-logo.png",
      "adminUserDisplayName": "Zhang San",
      "clientIp": "127.0.0.1",
      "operationType": "create",
      "resourceType": "user",
      "eventDetail": "The integrated application Discourse was modified",
      "operationParam": "{\"ext\":{\"_dontFinishNotYet\":true,\"_appName\":\"Discourse\"},\"protocol\":\"oidc\",\"isAsa\":false,\"name\":\"Discourse\",\"oidcConfig\":{\"grant_types\":[\"authorization_code\",\"password\",\"refresh_token\"],\"response_types\":[\"code\"],\"id_token_signed_response_alg\":\"RS256\",\"token_endpoint_auth_method\":\"client_secret_post\",\"introspection_endpoint_auth_method\":\"client_secret_post\",\"revocation_endpoint_auth_method\":\"client\"}}",
      "success": true,
      "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36",
      "parsedUserAgent": {
        "device": "Desktop",
        "browser": "Chrome",
        "os": "Windows"
      },
      "geoip": {
        "location": {
          "lon": 116.3889,
          "lat": 39.9288
        },
        "country_name": "China",
        "country_code2": "CN",
        "country_code3": "CN",
        "region_name": "Beijing",
        "region_code": "BJ",
        "city_name": "Beijing",
        "continent_code": "AS",
        "timezone": "Asia/Shanghai"
      },
      "timestamp": "2022-09-20T08:55:00.188+0800",
      "requestId": "b63b9772-384c-4f2d-981b-01d1feed964d"
    }
  }
}

Data structure ​

ListWebhooksDto ​

| Name| Type|

Is it required?
|
Description
|
Example value
| | ----- | ------ | ------------------- ------------------- | ------------------------------ ------ | ------------------------------------- | | page | number | No | Current page number, starting from 1 | 1 | | limit | number | No | Number per page, maximum cannot exceed 50, default is 10 | 10 |

AdminAuditLogRespData ​

| Name | Type |

Is it required?
|
Description
|
Example value
| | ---------- | ------ | ------------------------------ -------- | ----------------------------------------- ---------------------------- | --------------------- ---------------- | | totalCount | number | yes | total number of records | 1 | | list | array | yes | return list nested type: AdminAuditLogDto. | |

AdminAuditLogDto ​

| Name| Type|

Is it required?
|
Description
|
Example value
| | -------------------- | ---- --- | -------------------------------------- | ------- -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- ------------------------------------------------ | - -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- --- | | adminUserId | string | yes | The administrator's user ID| xxx | | adminUserAvatar | string | yes | Admin user avatar | https://files.authing.co/authing-console/default-app-logo.png | | adminUserDisplayName | string | yes | Admin user display name, displayed in the following user field order: nickname > username > name > givenName > familyName -> email -> phone -> id | xxxx xxx | | clientIp | string | no | Client IP, can be filtered according to the client IP at login. By default, the login history of all login IPs is not obtained. | 127.0.0.1 | | operationType | string | yes | Operation type:
- create: create
- delete: delete
- import: import
- export: export
- update: modify
- refresh: refresh
- sync: synchronize
- invite: invite
- resign: resign
- recover: recover
- disable: disable
- userEnable: enable
| all | | resourceType | string | yes | Event type:
- user: user
- userpool: user pool
- tenant: tenant
- userLoginState: user login state
- userAccountState: user account state
- userGroup: user group
- fieldEncryptState: field encryption state
- syncTask: synchronization task
- socialConnection: social identity source
- enterpriseConnection: social identity source
- customDatabase: custom database
- org: organization
- cooperator: collaboration administrator
- application:Application
- resourceNamespace: Permission group
- resource: Resource
- role: Role
- roleAssign: Role authorization
- policy: Policy
| all | | eventDetail | string | No | Event details | The integrated application "Discourse" was modified | | operationParam | string | No | Specific operation parameters | {"ext":{"_dontFinishNotYet":true,"_appName":"Discourse"},"protocol":"oidc","isAsa":false,"name":"Discourse","oidcConfig":{"grant_types":["authorization_code","password","refresh_token"],"response_types ":["code"],"id_token_signed_response_alg":"RS256","token_endpoint_auth_method":"client_secret_post","introspection_endpoint_auth_method":"client_secret_post","revocation_endpoint_auth_method":"client"} | | originValue | string | no | original value | | | targetValue | string | no | new value | | | success | boolean | yes | whether it was successful| true | | userAgent | string | yes | User Agent | Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36 | | parsedUserAgent | | yes | Parsed User Agent Nested type: ParsedUserAgent. | | | geoip | | yes | Geolocation Nested type: GeoIp. | | | timestamp | string | yes | Time | 2022-09-20T08:55:00.188+0800 | | requestId | string | yes | Request ID| b63b9772-384c-4f2d-981b-01d1feed964d |

ParsedUserAgent ​

NameType
Is it required
Description
Sample value
devicestringYesDevice type usedDesktop
browserstringYesBrowser nameChrome
osstringYesOperating systemWindows

GeoIp ​

NameType
Is it required
Description
Sample value
locationYesGeographic location Nested type: GeoIpLocation.
country_namestringYesCountry NameChina
country_code2stringYesCountry Code 2CN
country_code3stringYesCountry Code 3CN
region_namestringYesRegion NameBeijing
region_codestringYesRegion CodeBJ
city_namestringYesCity NameBeijing
continent_codestringYesContinent CodeAS
timezonestringYesTime ZoneAsia/Shanghai

GeoIpLocation ​

NameType
Required
Description
Sample Value
lonnumberislongitude116.3889
latnumberislatitude39.9288