HCP Vault Radar API 인증

HCP Vault Radar API 인증

HCP Vault Radar API는 HCP 인증 메커니즘을 사용해요.

출처: 문서

본문

인증

HCP API는 요청을 승인하기 위해 액세스 토큰이 필요해요.

  • HCP 클라이언트 ID와 시크릿으로 액세스 키를 생성하세요.다음 예시 응답에서 bearer 액세스 토큰은 1시간 동안 유효해요.
$ curl --location "https://auth.idp.hashicorp.com/oauth2/token" \
--header "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "client_id=$HCP_CLIENT_ID" \
--data-urlencode "client_secret=$HCP_CLIENT_SECRET" \
--data-urlencode "grant_type=client_credentials" \
--data-urlencode "audience=https://api.hashicorp.cloud"
{
  "access_token": "eyJhbG...sInR...",
  "expires_in": 3600,
  "token_type": "Bearer"
}
  • HCP_ACCESS_TOKEN 환경 변수를 액세스 토큰으로 설정하세요. 이 작업을 하면 API와 상호작용할 때 토큰을 더 쉽게 참조할 수 있어요.
$ export HCP_ACCESS_TOKEN=<access-token>

자세한 내용은 HashiCorp Cloud Platform 인증 문서를 참고하세요.

더 알아보기 (Learn more)