Tenant Level - Set JWT Authentication Secret

URL: /admin/api/v1/tenants/{tenantId}/jwtAuthenticationSecret

Method: PUT

Authentication: Super credentials

Field

Data type

Mandatory

Description

Validations

tenantId / Tenant FQDN

String

Y

The tenant id or tenant FQDN for which endpoint behavior mode will be configured

Validate if the tenant id is a valid tenantid or not.

Request body

Field

Data type

Mandatory

Description

Validations

 

String

N

The authentication secret; for example:

2deC;p<V:3#p85?S3T#,4S][qpJ6&7R-7KT(C"rET(:<HPr3

Validation of authentication secret. it must contain at least one:

  • capital letter

  • special character

Length of authentication secret is dependent on JWT signing algorithm. For HS384, size minimum 48 characters.

Should be encoded in Base64.

13gb5Zi3sDzs8oNAUiHlvd2SjBRZnnoAlQ3l1eIbEFlbsciNCglGuFw8sNNLyAEZb  (BASE 64)

Response body

Field

Data type

Mandatory

Description

version

String

Y

Defines the version of the API.

status

String

Y

Defines the response status. For a successful response, its value will be “success”.

data

Object

Y

This is the element which encapsulates the API response. For this API, its value is null.

secret

String

Y

This is the new authentication secret generated on the change of signing algorithm.

{

  "version": "1",

  "status": "success",

  "data": {

        "authenticationSecret": [{

            "secret": "asdfasdfasfLXZlcnktbG9uZy1zZWNyZXQta2V5LWZvci1zaWduaW5nLWp3dC10b2tlbnM="

        }]

    }

}

HTTP status codes, error codes, and messages

HTTP response code

Error code

Error message

Scenario

400

101017

Invalid request

If signing algorithm name is invalid.

Any other Request body validation failure.

404

101018

Signing Algorithm not configured

If signing algorithm is fetched while it’s not configured at tenant level.

404

101019

Authentication Secret not configured

If authentication secret is fetched while it’s not configured at tenant level.

403

 

 

Unauthorized user if anybody other than Super admin tries to access.

Invalid tenant id/FQDN.

500

101020

Internal server error

Internal server error.

{

    "version": "1",

    "status": "failure",

    "error": {

        "code": 101017,

        "message": "Invalid request",

        "errors": []

    }

}