AIM issues authenticating with HASH or PATH

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

AIM issues authenticating with HASH or PATH

L2 Linker

I'm testing AIM authentication, but it fails with the following error if I try restricting to HASH or PATH. If I remove those and just use ALLOWED MACHINES, my script works just fine.

[08/04/2019 | 13:24:35] | :: | APPAP087E Application authentication failure for Application APPID (CASCU095E Failed to find out application script file path. (Error: Process has no arguments. (command: "), Error code: -1).)

[08/04/2019 | 13:24:35] | :: | APPAP002E Provider "ProviderName" has failed to fetch password with query [Safe="safename";Object="ObjectName"] for application [APPID]. Fetch reason: []. Failure reason: [APPAP087E Application authentication failure]

 

 This is my setup:

Installed AIM on Server 2012.

Created Application.

Granted safe permission for application and provider.

Hash = Created using the following command - C:\Program Files (x86)\CyberArk\ApplicationPasswordProvider\Utils> .\AIMGetAppInfo.exe gethash /Filepath c:\tmp\myfile.ps1

PATH = c:\tmp\myfile.ps1

 

Inside my script, I am using the following command to retrieve the password. If I run this code manually or run my script without HASH or PATH configured, it works just fine. Otherwise it fgails with the errors above.

C:\Program Files (x86)\CyberArk\ApplicationPasswordSdk>CLIPasswordSDK.exe getpassword /p AppDescs.AppID=$AppID /p query="Safe=$strSafeName;Object=$strObjectName" /o Password

8 REPLIES 8

L6 Presenter

Have you tried below solution? Looks like you didn't create hash in a correct way for powershell script

 

https://community.cyberark.com/s/article/00004787

 

L4 Transporter

Have you tried below solution? Looks like you didn't create hash in a correct way for powershell script

 

https://community.cyberark.com/s/article/00004787

 

L2 Linker

Hi Ankush,

 

I am using the same format I found in a related post found below at the bottom. When I tried using the article you referenced, I get an error stating "CLP010s: Parameter "powershell.exe" is redundant".

 

can you try AIMGetAppInfo.exe gethash /FilePath "C:\AIMTest\psscript.ps1"

 

https://community.cyberark.com/s/feed/0D52J00006aGVSDSA4

 

L6 Presenter

Can you try adding powershell.exe also to path may be?

L4 Transporter

Can you try adding powershell.exe also to path may be?

L2 Linker

I tried both methods and it caused the same error.

L2 Linker

Weirdly enough, the “only” way I can launch the powershell script and have it authorize the HASH is by “cmd /c powershell.exe C:\tmp\myfile.ps1”. If I try to launch it by dot sourcing like I have been, it fails with the error message above. Using the cmd launch process give accurate errors to as in hash not authorized or file path not correct. 

L1 Bithead

4 years later I had the same issue, so here is my solution based on the last reply by rvipp.

 

It seems that the AppProvider will look for a "/" to parse the script name in the command and will fail to find it if given with "-"

 

This works: "powershell.exe /file myscript.ps1"

This doesn't: "powershell.exe -file myscript.ps1"

  • 1561 Views
  • 8 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!