Skip to content

Test JWT Configuration in AWS S3

This guide explains how to test your JWT (JSON Web Token) configuration within the Privacera Dataserver.

JWT validation is supported only in Self-Managed deployments starting from Privacera release 9.0.3.1.

Testing Procedure

To validate your JWT, execute the following curl command:

Bash
curl -v -X POST \
    -H 'Content-Type: application/json' \
    -d '{"tokenStr": "<JWT_TOKEN>"}' \
    https://<DATASERVER_URL>/services/jwt/validate

Replace the placeholders:

<JWT_TOKEN>: Your actual JSON Web Token.
<DATASERVER_URL>: The Privacera Dataserver URL.

The Dataserver will return a JSON object indicating the status of the token validation.

  • Http Status Codes

    200 - if able to process request successfully
    400 - if the payload is empty in request OR the token value is empty in the request    
    
  • Content type: application/json

JSON Response Formats

  • Valid Token
    If the provided JWT is valid, the response will be:

    JSON
    {
      "statusCode": 0,
      "isValid": true,
      "expiresOn": "<Date>",
      "algorithm": "<algorithm-type>",
      "message": "Provided JWT token is valid"
    }
    

  • Invalid Token
    If the provided JWT is invalid (e.g., malformed or expired), the response will be:

    JSON
    {
      "statusCode": 1,
      "isValid": false,
      "message": "Failed to validate JWTToken. Error"
    }
    

  • Empty Payload or Empty JWT Token
    If the request payload is empty, or the tokenStr value within the payload is empty, the response will be:

    JSON
    {
      "statusCode": 2,
      "isValid": false,
      "message": "JWT token is empty in request payload"
    }
    

Comments