PASWS001E Error occurred: CAJWT002E JWT token structure is invalid - missing or wrong fields in token.
145
Created On 11/10/26 10:54 AM - Last Modified 11/10/26 15:55 PM
Symptom
When logging into the PVWA through the REST API the following error is generated:
PASWS001E Error occurred: CAJWT002E JWT token structure is invalid - missing or wrong fields in token.
Environment
12.2;12.4;12.3;12.5;12.6;12.7;13.0;13.2;13.1;14.0;13.3;14.6 Privileged Access Manager (PAM, self-hosted) Password Vault Web Access;Cyber-Ark API/SDK
Cause
The token header needs to be in the Base64 String format. When attempting to make REST API scripts with ChatGPT (8/12/2024) the sample code that generates attempts to use a bearer token:
headers = {
'Authorization': f'Bearer {session_token}',
'Content-Type': 'application/json'
}
Resolution
Pass the session token as string:
headers = {
'Authorization': session_token,
'Content-Type': 'application/json'
}