GenerateJwtAuthenticationToken

Updated at:

Generates a JWT authentication token.

Operation description

This API performs authentication and authorization based on an access token issued by IDaaS.

Make sure that the passed access token has the functional authorization to access the built-in PAM (Privileged Access Management) application of IDaaS and obtain authentication tokens.

Note

The corresponding scope is urn:cloud:idaas:pam|authentication_token: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

POST /v2/{instanceId}/authenticationTokens/_/actions/generateJwt HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

instanceId

string

Yes

The instance ID.

idaas_ue2jvisn35ea5lmthk267xxxxx

Request parameters

Parameter

Type

Required

Description

Example

Authorization

string

Yes

The authentication information. Format: Bearer ${access_token}.

Note

Enter the access token issued by IDaaS.

Bearer xxxxxx

body

object

No

The request body.

credentialProviderIdentifier

string

Yes

The credential provider identifier.

test_example_identifier

issuer

string

No

The iss field of the JWT.

https://test.issuer.com

subject

string

Yes

The sub field of the JWT.

test_jwt_subject

audiences

array

Yes

The aud field of the JWT.

string

No

The JWT audience.

test_jwt_audience

customClaims

object

No

The custom claims.

Important Key-value pairs. The keys must be of the string type.

{"department":"engineering"}

any

No

The custom claim key-value pairs.

engineering

expiration

integer

No

The validity period of the JWT, in seconds.

900

includeDerivedShortToken

boolean

No

Specifies whether to include a derived short token when generating the JWT.

true

Response elements

Element

Type

Description

Example

object

The JWT authentication token details.

instanceId

string

The instance ID.

idaas_ue2jvisn35ea5lmthk267xxxxx

authenticationTokenId

string

The authentication token ID.

atntkn_01kqflm0sxxx8nmdc1cb5dskxxxxx

credentialProviderId

string

The credential provider ID.

atp_01kr2cmj5gxxx4fvmls2e93dxxxxx

createTime

integer

The creation time of the authentication token. The value is a UNIX timestamp in milliseconds.

1649830225000

updateTime

integer

The update time of the authentication token. The value is a UNIX timestamp in milliseconds.

1649830225000

authenticationTokenType

string

The authentication token type.

Note

The value is fixed as jwt, which indicates a JWT authentication token.

jwt

revoked

boolean

Indicates whether the authentication token is revoked.

false

creatorType

string

The creator type of the authentication token. Valid values:

  • application: application

application

creatorId

string

The creator ID of the authentication token.

app_ngtkgrrxxxxktg5eao6z4xxxxx

consumerType

string

The consumer type of the authentication token. Valid values:

  • application: application

  • custom: custom type

custom

consumerId

string

The consumer ID of the authentication token.

test_jwt_subject

expirationTime

integer

The expiration time of the authentication token. The value is a UNIX timestamp in milliseconds.

1772693568000

jwtContent

object

The content of the JWT authentication token.

jwtValue

string

The JWT content.

eyJhbGciOixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

derivedShortToken

string

The derived short token of the JWT.

sk-Nx2vzxxxxxxxxxxxxxxxxx

Examples

Success response

JSON format

{
  "instanceId": "idaas_ue2jvisn35ea5lmthk267xxxxx",
  "authenticationTokenId": "atntkn_01kqflm0sxxx8nmdc1cb5dskxxxxx",
  "credentialProviderId": "atp_01kr2cmj5gxxx4fvmls2e93dxxxxx",
  "createTime": 1649830225000,
  "updateTime": 1649830225000,
  "authenticationTokenType": "jwt",
  "revoked": false,
  "creatorType": "application",
  "creatorId": "app_ngtkgrrxxxxktg5eao6z4xxxxx",
  "consumerType": "custom",
  "consumerId": "test_jwt_subject",
  "expirationTime": 1772693568000,
  "jwtContent": {
    "jwtValue": "eyJhbGciOixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "derivedShortToken": "sk-Nx2vzxxxxxxxxxxxxxxxxx"
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.