ObtainCredential

Updated at:

Retrieves the plaintext of a secret.

Operation description

This API uses an access token from IDaaS for authentication and authorization.

The access token must have permissions to obtain static credentials for the built-in privileged access management (PAM) application in IDaaS.

Note

The required scope is urn:cloud:idaas:pam|credential:obtain.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request syntax

GET /v2/{instanceId}/credentials/_/actions/obtain HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

instanceId

string

Yes

The ID of the IDaaS instance.

idaas_ue2jvisn35ea5lmthk267xxxxx

Request parameters

Parameter

Type

Required

Description

Example

Authorization

string

Yes

Authentication information. The format is Bearer ${access_token}.

Note

Use an access token issued by IDaaS.

Bearer xxxxxx

credentialIdentifier

string

Yes

The identifier for the credential to obtain.

credential_identifier_test

Response elements

Element

Type

Description

Example

object

instanceId

string

The EIAM instance ID.

idaas_ue2jvisn35ea5lmthk267xxxxx

credentialId

string

The credential ID.

cred_mkv7rgt4d7i4u7zqtzev2mxxxx

status

string

The status of the credential. Valid values:

  • enabled: The credential can be used.

  • disabled: The credential cannot be used.

enabled

credentialIdentifier

string

The credential identifier.

credential_identifier_test

credentialName

string

The credential name.

credential_name

credentialSubjectType

string

The credential's subject type. Valid values:

  • authentication_token_provider: An authentication token provider.

authentication_token_provider

credentialSubjectId

string

The ID of the credential's subject.

apt_werthgfdsasffxxxxx

credentialScenarioLabel

string

The usage scenario for the credential. Valid values:

  • llm: For use with a large language model.

  • saas: For use with a third-party SaaS application.

llm

credentialType

string

The credential type. Valid values:

  • api_key: The credential is an API key.

  • oauth_client: The credential represents an OAuth client.

api_key

credentialCreationType

string

Indicates how the credential was created. Valid values:

  • system_init: System-initiated.

  • user_custom: User-created.

user_custom

description

string

The credential description.

credential_description

createTime

integer

The creation time of the credential, formatted as a Unix timestamp in milliseconds.

1649830225000

updateTime

integer

The last update time of the credential, formatted as a Unix timestamp in milliseconds.

1649830227000

credentialContent

object

The detailed content of the credential. The structure of this object depends on the value of credentialType.

oauthClientContent

object

Contains details for an OAuth client credential. Returned only when credentialType is oauth_client.

clientId

string

The client_id for OAuth 2.0.

dmvncmxersdxxxxxx

clientSecret

string

The client_secret for OAuth 2.0.

nsklnertyt5ddwizncxxxx

apiKeyContent

object

Contains details for an API key credential. Returned only when credentialType is api_key.

apiKey

string

The API key value.

sk-nsklncmwizncxxxx

credentialSharingScope

string

The sharing scope of the credential, such as whether it is exclusive to a specific account.

user_exclusive

exclusiveUserId

string

The ID of the account that exclusively owns the credential. This field is present only when credentialSharingScope is user_exclusive.

user_xxx

credentialExternalId

string

Examples

Success response

JSON format

{
  "instanceId": "idaas_ue2jvisn35ea5lmthk267xxxxx",
  "credentialId": "cred_mkv7rgt4d7i4u7zqtzev2mxxxx",
  "status": "enabled",
  "credentialIdentifier": "credential_identifier_test",
  "credentialName": "credential_name",
  "credentialSubjectType": "authentication_token_provider",
  "credentialSubjectId": "apt_werthgfdsasffxxxxx",
  "credentialScenarioLabel": "llm",
  "credentialType": "api_key",
  "credentialCreationType": "user_custom",
  "description": "credential_description",
  "createTime": 1649830225000,
  "updateTime": 1649830227000,
  "credentialContent": {
    "oauthClientContent": {
      "clientId": "dmvncmxersdxxxxxx",
      "clientSecret": "nsklnertyt5ddwizncxxxx"
    },
    "apiKeyContent": {
      "apiKey": "sk-nsklncmwizncxxxx\n"
    }
  },
  "credentialSharingScope": "user_exclusive",
  "exclusiveUserId": "user_xxx",
  "credentialExternalId": ""
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.