Snow-Shell/servicenow-powershell

Set-ServiceNowAuth shows True even if credentials are invalid

Closed this issue · 1 comments

If I access https://instance.service-now/api/now/v1 it doesn't prompt for credentials anymore.
Hence, using Test-ServiceNowAuthIsSet and Set-ServiceNowAuth will show the authentication as True instead of False.

Is it just me?

There's no actual validation of the credentials you store with either command. The Set command returns true to simply return something. Behavior from the original author nobody has ever changed.

The Test command simply checks to see if the global credential variable has a value. Something that will make more sense if we ever make that variable private to the module and is only useful to see if something is in memory already or not. True validation only comes from attempting a command, which I could probably turn into better behavior for the Test command.