본문 바로가기
WIKI 기술 지식 베이스

Authentication Information API

원문 보기 위키 갱신

출처: 문서

본문

인증 정보 API

1.0에서 도입됨 {: .label .label-purple }

현재 인증된 사용자의 정보를 반환해요. 여기에는 사용자 이름, 역할, 백엔드 역할, 사용자 정의 속성 및 테넌트 멤버십이 포함돼요. 인증 문제를 디버깅하거나 사용자가 보유한 권한을 확인하는 데 사용하세요.

엔드포인트

GET  /_plugins/_security/authinfo
POST /_plugins/_security/authinfo

쿼리 매개변수

다음 표에서는 사용 가능한 쿼리 매개변수를 보여줘요. 모든 쿼리 매개변수는 선택 사항이에요.

매개변수 데이터 타입 설명
auth_type String 현재 인증 요청의 유형이에요.
verbose Boolean 자세한 응답을 반환할지 여부예요.

예제 요청

다음 예제 요청은 현재 인증된 사용자의 인증 정보를 검색해요:

GET /_plugins/_security/authinfo

{% include copy-curl.html security=true %}

다음 예제 요청은 자세한 인증 정보를 검색해요:

GET /_plugins/_security/authinfo?verbose=true

{% include copy-curl.html security=true %}

예제 응답

기본 응답은 사용자, 역할 및 테넌트를 설명해요:

{
  "user": "User [name=admin, backend_roles=[admin], requestedTenant=null]",
  "user_name": "admin",
  "user_requested_tenant": null,
  "remote_address": "192.168.65.1:21728",
  "backend_roles": [
    "admin"
  ],
  "custom_attribute_names": [],
  "roles": [
    "all_access"
  ],
  "tenants": {
    "global_tenant": true,
    "admin_tenant": true,
    "admin": true
  },
  "principal": null,
  "peer_certificates": "0",
  "sso_logout_url": null
}

자세한 응답에는 크기 필드가 추가돼요:

{
  "user": "User [name=admin, backend_roles=[admin], requestedTenant=null]",
  "user_name": "admin",
  "user_requested_tenant": null,
  "remote_address": "192.168.65.1:48870",
  "backend_roles": [
    "admin"
  ],
  "custom_attribute_names": [],
  "roles": [
    "all_access"
  ],
  "tenants": {
    "global_tenant": true,
    "admin_tenant": true,
    "admin": true
  },
  "principal": null,
  "peer_certificates": "0",
  "sso_logout_url": null,
  "size_of_user": "928 bytes",
  "size_of_custom_attributes": "112 bytes",
  "size_of_backendroles": "84 bytes"
}

응답 본문 필드

응답 본문은 다음 필드를 포함하는 JSON 객체예요.

속성 데이터 타입 설명
user String 사용자 이름과 백엔드 역할을 포함한 사용자 객체의 문자열 표현이에요.
user_name String 인증된 사용자의 사용자 이름이에요.
backend_roles Array of strings 사용자와 연결된 백엔드 역할로, 일반적으로 외부 인증 시스템에서 가져와요.
roles Array of strings 사용자에게 할당된 OpenSearch Security 역할로, 권한을 결정해요.
tenants Object 사용자가 액세스할 수 있는 테넌트로, true는 읽기-쓰기 액세스를, false는 읽기 전용 액세스를 나타내요.
principal String 사용자의 인증 주체(사용 가능한 경우)예요.
peer_certificates String 사용자 인증과 관련된 피어 인증서의 수예요.
sso_logout_url String 싱글 사인온(SSO) 인증의 로그아웃 URL(해당하는 경우)이에요.
remote_address String 요청을 보내는 클라이언트의 IP 주소와 포트예요.
custom_attribute_names Array of strings 사용자와 연결된 사용자 정의 속성의 이름이에요.
user_requested_tenant String 사용자가 전환을 요청한 테넌트의 이름(있는 경우)이에요.

자세한 응답을 요청하면 다음 추가 필드가 포함돼요.

속성 데이터 타입 설명
size_of_user String 메모리에 있는 사용자 객체의 크기예요.
size_of_backendroles String 사용자의 백엔드 역할 크기예요.
size_of_custom_attributes String 사용자의 사용자 정의 속성 크기예요.

더 알아보기 (Learn more)