Back to Node Auth0

Class CredentialsClient

docs/classes/management.SDK.CredentialsClient.html

5.9.111.2 KB
Original Source

Class CredentialsClient

Index

Constructors

constructor

Methods

listcreategetdeleteupdate

Properties

_options

Constructors

constructor

new CredentialsClient(options: BaseClientOptions): CredentialsClient

Parameters

Returns CredentialsClient

Methods

list

list(
client_id: string,
requestOptions?: CredentialsClient.RequestOptions,
): HttpResponsePromise<ClientCredential[]>

Get the details of a client credential.

Important : To enable credentials to be used for a client authentication method, set the client_authentication_methods property on the client. To enable credentials to be used for JWT-Secured Authorization requests set the signed_request_object property on the client.

Parameters

  • client_id: string

ID of the client.

Request-specific configuration.

Returns HttpResponsePromise<ClientCredential[]>

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.NotFoundError

Throws

Management.TooManyRequestsError

Example

await client.clients.credentials.list("client_id")Copy

create

create(
client_id: string,
request: PostClientCredentialRequestContent,
requestOptions?: CredentialsClient.RequestOptions,
): HttpResponsePromise<PostClientCredentialResponseContent>

Create a client credential associated to your application. Credentials can be used to configure Private Key JWT and mTLS authentication methods, as well as for JWT-secured Authorization requests.

Public Key

Public Key credentials can be used to set up Private Key JWT client authentication and JWT-secured Authorization requests.

Sample:

{
"credential_type": "public_key",
"name": "string",
"pem": "string",
"alg": "RS256",
"parse_expiry_from_cert": false,
"expires_at": "2022-12-31T23:59:59Z"
}
Certificate (CA-signed & self-signed)

Certificate credentials can be used to set up mTLS client authentication. CA-signed certificates can be configured either with a signed certificate or with just the certificate Subject DN.

CA-signed Certificate Sample (pem):

{
"credential_type": "x509_cert",
"name": "string",
"pem": "string"
}

CA-signed Certificate Sample (subject_dn):

{
"credential_type": "cert_subject_dn",
"name": "string",
"subject_dn": "string"
}

Self-signed Certificate Sample:

{
"credential_type": "cert_subject_dn",
"name": "string",
"pem": "string"
}

The credential will be created but not yet enabled for use until you set the corresponding properties in the client:

Parameters

  • client_id: string

ID of the client.

Request-specific configuration.

Returns HttpResponsePromise<PostClientCredentialResponseContent>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.NotFoundError

Throws

Management.TooManyRequestsError

Example

await client.clients.credentials.create("client_id", { credential_type: "public_key" })Copy

get

get(
client_id: string,
credential_id: string,
requestOptions?: CredentialsClient.RequestOptions,
): HttpResponsePromise<GetClientCredentialResponseContent>

Get the details of a client credential.

Important : To enable credentials to be used for a client authentication method, set the client_authentication_methods property on the client. To enable credentials to be used for JWT-Secured Authorization requests set the signed_request_object property on the client.

Parameters

  • client_id: string

ID of the client.

  • credential_id: string

ID of the credential.

Request-specific configuration.

Returns HttpResponsePromise<GetClientCredentialResponseContent>

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.NotFoundError

Throws

Management.TooManyRequestsError

Example

await client.clients.credentials.get("client_id", "credential_id")Copy

delete

delete(
client_id: string,
credential_id: string,
requestOptions?: CredentialsClient.RequestOptions,
): HttpResponsePromise<void>

Delete a client credential you previously created. May be enabled or disabled. For more information, read Client Credential Flow.

Parameters

  • client_id: string

ID of the client.

  • credential_id: string

ID of the credential to delete.

Request-specific configuration.

Returns HttpResponsePromise<void>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.TooManyRequestsError

Example

await client.clients.credentials.delete("client_id", "credential_id")Copy

update

update(
client_id: string,
credential_id: string,
request?: PatchClientCredentialRequestContent,
requestOptions?: CredentialsClient.RequestOptions,
): HttpResponsePromise<PatchClientCredentialResponseContent>

Change a client credential you previously created. May be enabled or disabled. For more information, read Client Credential Flow.

Parameters

  • client_id: string

ID of the client.

  • credential_id: string

ID of the credential.

Request-specific configuration.

Returns HttpResponsePromise<PatchClientCredentialResponseContent>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.NotFoundError

Throws

Management.TooManyRequestsError

Example

await client.clients.credentials.update("client_id", "credential_id")Copy

Properties

Protected Readonly_options

_options: NormalizedClientOptionsWithAuth<BaseClientOptions>

Settings

Member Visibility

  • Protected
  • Inherited

ThemeOSLightDark

On This Page

Constructors constructor Methods listcreategetdeleteupdate Properties _options