pspete / psPAS

PowerShell module for CyberArk Privileged Access Security REST API
https://pspas.pspete.dev
MIT License
293 stars 91 forks source link

Empty Response Always #232

Closed cico971 closed 4 years ago

cico971 commented 4 years ago

Describe the issue When i try to connect with CyberArk or LDAP authentication i always have no token, the password is correct, when i tried with postman i got a token.

To Reproduce Steps to reproduce the behavior:

[string]$baseURI = "https://cyberark.security.local" [string]$authenticationMethod = "LDAP" $session = New-PASSession -Credential $credentials -BaseURI $baseURI -type $authenticationMethod -Verbose -Debug -SkipCertificateCheck Write-host $session

Expected behavior token printed

Screenshots & Console Output If applicable, add screenshots to help explain your problem.

Console Output Code Block: image

Your Environment

pspete commented 4 years ago

Please share your command, output and error message (or complete the details in the issue template).

How are you determining that you no token is returned? CyberArk/LDAP logon is straightforward: https://pspas.pspete.dev/docs/authentication/#ldap-authentication

Use Get-PASLoggedOnUser after New-PASSession to confirm logon. If you need the token value, you can retrieve it with Get-PASSession

pspete commented 4 years ago

@cico971 - Thanks for the additional info, it helps. This is expected - New-PASSession returns no output to the console on success. After authenticating to the api using psPAS, the module saves the Authorization token in the module scope, and takes care of providing this value in all subsequent requests. If you want the actual value returned from the api, Get-PASSession can return the details from the module scope:

(Get-PASSession).WebSession.Headers["Authorization"]
pspete commented 4 years ago

As there has been no update, am assuming the previous answer has helped. Closing this now.

Feel free to comment if you feel it should be reopened.