Authentication ​
This version of the API is integrated with Active Directory authentication, and API Keys are not required. When a script is executed under the identity of a user's account, all access to data is the same as if the user were to login to the Passwordstate web site.
Authenticating to the Windows Integrated API can be achieved via the detection of the domain account executing the script (Windows Only), or you can also pass authentication details to the API. Below are examples of both methods.
Note: The Windows Integrated API (WinAPI) requires your Passwordstate web server to be joined to the same domain as the User Accounts you wish to use to execute the API scripts.
Powershell
# PowerShell Request - Using Default Credentials (currently logged in Windows Account)
$PasswordstateUrl = 'https://passwordstate/winapi/passwordlists/<PasswordListID>'
Invoke-Restmethod -Method GET -Uri $PasswordstateUrl -UseDefaultCredentialsPowershell
# PowerShell Request - Using Specified Credentials
$Username = "domain\username"
$Password = "MyPassword"
$SecureString = ConvertTo-SecureString -AsPlainText $Password -Force
$Creds = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $Username, $SecureString
$PasswordstateUrl = 'https://passwordstate/winapi/passwordlists/<PasswordListID>'
Invoke-Restmethod -Method GET -Uri $PasswordstateUrl -Credential $CredsJson
# Response
HTTP/1.1 200
[
{
"AllowExport": true,
"AuthenticationPerSession": false,
"AuthenticationType": "None Required",
"CodePage": "Unicode (UTF-8)",
"Description": "Various web sites on the net",
"ForcePasswordGenerator": false,
"GeneratorName": "Default Password Generator",
"Guide": "",
"HidePasswords": "false:false:false",
"ImageFileName": "website.png",
"PasswordGeneratorID": 1,
"PasswordList": "Web Site's",
"PasswordListID": 27,
"PasswordResetEnabled": false,
"PasswordStrengthPolicyID": 7,
"PolicyName": "SQL Server Policy",
"PreventBadPasswordUse": true,
"PreventDragDrop": true,
"PreventExpiryDateModification": false,
"PreventPasswordReuse": 5,
"PrivatePasswordList": false,
"ProvideAccessReason": true,
"ResetExpiryDate": 0,
"SetExpiryDate": 0,
"ShowGuide": false,
"TimeBasedAccessRequired": false,
"NoApprovers": "1",
"DisableNotifications": false,
"TotalPasswords": 23,
"TreePath": "\ISP Accounts",
"SiteID":"0",
"SiteLocation":"Internal"
}
]