pspete / psPAS

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

New-PASSession -- Invoke-PASRestMethod : Runtime Error #308

Closed kortovilis closed 4 years ago

kortovilis commented 4 years ago

Your Environment

Expected Behaviour

Can't establish PASSession New-PASSession -Credential $cred -BaseURI https://acb.local/PasswordVault/v10

Current Behaviour

I got next error Invoke-PASRestMethod : Runtime Error body font family Verdana font weight normal font size 7em color black p font family Verdana font weight normal color black margin top 5px b font family Verdana font weight bold color black margin top 5px H1 font family Verdana font weight normal font size 18pt color red H2 font family Verdana font weight normal font size 14pt color maroon pre font family Consolas Lucida Console Monospace font size 11pt margin 0 padding 0 5em line height 14pt marker font weight bold color black text decoration none version color gray error margin bottom 10px expandable text decoration underline font weight bold color navy cursor hand media screen and max width 639px pre width 440px overflow auto white space pre wrap word wrap break word media screen and max width 479px pre width 280px Server Error in PasswordVault Application Runtime Error Description An exception occurred while processing your request Additionally another exception occurred while executing the custom error page for the first exception The request has been terminated At line:642 char:19

:ErrorRecord) [Invoke-PASRestMethod], Exception

pspete commented 4 years ago

Try

New-PASSession -Credential $cred -BaseURI https://acb.local

You can find detailed authentication instructions here: https://pspas.pspete.dev/docs/authentication/

Let us know if you still face a challenge

NathanielMaier commented 4 years ago

@kortovilis, BaseURI should just be the base path of your PVWA URL. Try the following instead:

New-PASSession -Credential $cred -BaseURI https://acb.local

NathanielMaier commented 4 years ago

Two minutes too slow... thought I could help ya out for once, @pspete 😛

kortovilis commented 4 years ago

Works, Thanks to both.. before I post "issue" I try to reach full URL, and get OK... that confused me... never mind, once again THX. PS C:> Invoke-WebRequest -Uri https://abc.local/passwordvault

StatusCode : 200 StatusDescription : OK Content : <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

                <HTML>
                   <HEAD id="headPart"><title>
                    Password Vault Sign In
                </title><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"...

RawContent : HTTP/1.1 200 OK Pragma: no-cache Cache-Control: no-cache, no-store, must-revalidate Content-Type: text/html; charset=utf-8 Expires: -1 Set-Cookie: CA22222=; path=/PasswordVault/; secure; HttpOnly... Forms : {Form1} Headers : {[Pragma, no-cache], [Cache-Control, no-cache, no-store, must-revalidate], [Content-Type, text/html; charset=utf-8], [Expires, -1]...} Images : {@{innerHTML=; innerText=; outerHTML=; outerText=; tagName=IMG; src=images/login_CALogo.png?v8.10.0}, @{innerHTML=; innerText=; outerHTML=; outerText=; tagName=IMG; src=images/login_CustomLogo.png}, @{innerHTML=; innerText=; outerHTML=; outerText=; tagName=IMG; src=images/login_Home_Img.png?v8.10.0}} InputFields : {@{innerHTML=; innerText=; outerHTML=<input name="EVENTTARGET" id="EVENTTARGET" type="hidden" value="">; outerText=; tagName=INPUT; name=EVENTTARGET; id=EVENTTARGET; type=hidden; value=}, @{innerHTML=; innerText=; outerHTML=<input name="EVENTARGUMENT" id="EVENTARGUMENT" type="hidden" value="">; outerText=;