Skip to main content

Hello,

We are using the secret safe api to pull secrets and plug them into our applications. When testing our script in  PowerShell it works, however, in Python, we are seeing a 404 error. Any idea? Our RunAs user is a domain account. TIA!

Hello ​@kimberlyv, Quick question just for clarification, the script is written in Python? When running it through PowerShell it works, but not run directly through a cmd prompt using Python?


@CalebG I’m sorry I see how that was confusing. We tested a generic powershell script with the same API registration info and RunAs user that we are using for our Python script. However, when we run the Python script, we get a 404 error. The PowerShell script just tests signing in and signing out. The Python script, we are also testing signing in and out, with the addition of pulling a secret from Secret Safe. The Python script cannot get past authentication. 

 

Directly from my customer:

 

Notice that in PS there is

"${baseUrl}Auth/SignAppIn

But I hit this url from python and it was 404.

try

{

     #Sign-In

     if ($verbose) { "Signing-in.."; }

     $signInResult = Invoke-RestMethod -Uri "${baseUrl}Auth/SignAppIn" -Method POST -Headers $headers -SessionVariable session;  

     if ($verbose) { "..Signed-in as {0}" -f $signInResult.UserName;  ""; }

}


@kimberlyv , is it safe to assume that you establish “${baseUrl}” earlier on in the Python Script? 

Also, is it meant to prompt them for a user and password to log in or is there a set user for the API? 


Reply