No Longer Able to Use the Swagger API

No Longer Able to Use the Swagger API

173
Created On 11/10/26 10:58 AM - Last Modified 11/10/26 15:51 PM


Symptom


The previous method for using the Swagger API from the PVWA will now result in a 401 error.

"ErrorCode": "CAWS00001E",

"ErrorMessage": ""



Environment


Privilege Cloud Cyber-Ark API/SDK

PVWA Swagger API

Cyber-Ark API/SDK Other



Cause


For security reasons, Idira has implemented a new workflow for using the Swagger API from the PVWA.



Resolution


If you log in to the PVWA using RADIUS, LDAP, or CyberArk authentication, the below instructions will work as-is. If you authenticate via SAML, you'll need to include the data from this process for step 5: https://community.cyberark.com/s/article/How-to-login-to-Swagger-using-SAML-authentication but be sure to delete the SecureMode parameter in the Data field.


Instructions for Using Swagger: 

1) Do not log in to the PVWA. If you are logged in, log out. (This is essential). Swagger will no longer work if you are already logged into the PVWA.

 

2) Navigate to https://<pvwa_host>/PasswordVault/swagger

 

3) Go to the "Auth" section and select "Expand Operations." You will use the "POST /api/Auth/{type}/Logon" subsection.

image.png

4) In the "type" parameter, enter the authentication method you use to log in to the PVWA. (So, depending your environment, you will either type ""CyberArk", "LDAP", "RADIUS", or "SAML".

 

5) In the "Data" field, enter ONLY the following and delete anything else:

{

 "UserName": "<YourUserName>",

 "Password": "<YourPassword>",

}

 

6) Click "Try it out."

image.png

7) In the response body, you should see a token generated. If you did, you've successfully authenticated (The Response Code box will also display "200"). You can now navigate to the other sections of the Swagger UI and perform actions as usual.

image.png

8) Remember that you cannot be logged into the PVWA and use the Swagger API at the same time. If you need to be logged into the PVWA, use an entirely different browser or open up a PVWA session in a Chrome Incognito tab. If you start getting errors in the middle of your Swagger session, check to make sure you're not logged into the PVWA. If you did log in to the PVWA, you will need to repeat steps 3-7 to generate a new token.

 

9) When you are finished, navigate back to the "Auth" section, but this time use the "POST /api/Auth/Logoff" subsection and click "Try it out!"


Troubleshooting: 
Problem: You receive ErrorCode PAWS013E: Authentication Error for User

a. Ensure you entered the correct Authentication Type in step 4 (LDAP, CyberArk, RADIUS, or SAML)

b. Ensure you entered your username and password correctly in step 5

Problem: You receive ErrorCode PASWS084E: A Potentially dangerous value was detected from the client

a. Ensure you removed the < and > symbols from the Username and Password example

Problem: You receive ErrorCode ITATS894E: An unhandled exception has occurred 

a. Ensure you entered your username and password instead of pasting in the example "YourUserName" or "YourPassword"

Problem: You authenticate successfully, but then future API calls give you ErrorCode CAWS00001E

a. Ensure you didn't log into the PVWA. If you did, log out and repeat steps 3-7 to generate a new token
b. Ensure you removed "securemode" from the data field in step 5. If you forgot to remove this on your original Auth call, you'll need to log in to the PVWA, log out from the PVWA, and then repeat steps 3-7 to generate a new session token. 

 
 


Actions
  • Print
  • Copy Link

    https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA1hj0000000lgZCAQ&lang=en_US&refURL=http%3A%2F%2Fknowledgebase.paloaltonetworks.com%2FKCSArticleDetail