How to login to Swagger using SAML authentication

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

Welcome Idira to LIVEcommunity!

Our community just got stronger! Explore new identity security resources, connect with experts, and discover more ways to learn and collaborate.

Meet Idira

PAM Self-Hosted Articles
3 min read
L1 Bithead
No ratings
Since v12.5 of the portal (or PVWA), authentication via Swagger has changed. Now users need to log into Swagger through the Auth API on the Swagger page. This describes how to use SAML authentication to login to Swagger.

Steps

Pre-requisites:-
 
  1. IdP initiated SSO must be set in the <appSettings> section of the <Drive letter>:\inetpub\wwwroot\PasswordVault\web.config file on the PVWA:-
<add key="EnableIdPInitiatedSso" value="yes"/>
 
  1. Find the User access URL of the Idira App from the IdP. For example, the Idira Application in Azure will be something like this:-
 

This is where to find this value in Azure:-

ka32J000000CnHeQAK__eid=ka32J000000CnHe&feoid=00N2J000009R3kv&refid=0EM2J000004DeUO.png
  1. Download the PS-SAML-Interactive module from the following website - https://github.com/allynl93/PS-SAML-Interactive
ka32J000000CnHeQAK__eid=ka32J000000CnHe&feoid=00N2J000009R3kv&refid=0EM2J000004DeVH.png
Procedure:-
 
On the machine you want to use for Swagger, place the PS-SAML-Interactive module into a separate directory and open this directory into a Powershell Administrator window. Then type the following:-
- import-module -name .\PS-SAML-Interactive.psm1
- $LoginURL = 'https://myapps.microsoft.com/signin/1ab23456-123a-12a3-a123-1234a567bc89?tenantId=a1b2c3d4-1ab2-12ab-ab1c-1abcd234567e'
- New-SAMLInteractive -LoginIDP $LoginURL
 
You will then be prompted for login credentials for your IdP. These credentials should be the ones you want to use to login to Swagger.
A SAMLResponse will be returned in the Powershell window. To make things easier, you could change the third command above to 'New-SAMLInteractive -LoginIDP $LoginURL > SAMLResponse.txt' so that the SAML Response is saved to a text file.
The SAML Response now needs to be URL encoded since it will probably contain characters that are not in a format that can be transmitted over the internet. Such characters include '+' or '#'. For this you can use a website such as www.samltools.com/url.php or meyerweb.com/eric/tools/dencoder (other sites are available).
Copy the urlencoded SAML Response into a notepad file or similar.
Navigate to the swagger page and click on the AUTH API. For the 'type' value use SAML and for the 'data' value use the following:-
SAMLResponse=<url encoded SAMLResponse>&apiUse=true
Note: Though the below screenshot says that setting "secureMode" to "true" is optional, the current workflow requires this key to either be deleted from the call or set to "false." If you have it set to "true," you will get errors on subsequent calls after authenticating. 
Ensure that Parameter content type is set to application/x-www-form-urlencoded
ka32J000000CnHeQAK__eid=ka32J000000CnHe&feoid=00N2J000009R3kv&refid=0EM2J000004DeWA.png
After clicking ‘Try it out’ you will see an authentication token in the Response body with a Response Code of 200.
ka32J000000CnHeQAK__eid=ka32J000000CnHe&feoid=00N2J000009R3kv&refid=0EM2J000004DeWP.png
This indicates that authorization was successful. Now you will be able to carry out tasks using the other APIs on the swagger page.

PLEASE NOTE: Authentication will fail if ANY user is already logged in to the PVWA or Web Portal through another tab on the same browser. If the user wants to use Swagger as well as being logged into the PVWA or Web Portal then Swagger will need to be loaded up with the browser window in incognito mode.

 
 
Rate this article:
  • 3673 Views
  • 0 comments
  • 0 Likes
Article Dashboard
Version history
Last Updated:
‎11-05-2026 12:08 PM
Updated by: