snazy2000 / SnipeitPS

Powershell API Wrapper for Snipe-it
MIT License
181 stars 47 forks source link

Will not connect to on-prem non-SSL setup? #273

Closed reardonp-fps closed 2 years ago

reardonp-fps commented 2 years ago

Context

Trying to set up SnipeitPS to solve some issues we are having (notably bulk checkins via spreadsheets). Cannot connect to our local server.

Your Environment

Expected Behavior

Connect-SnipeitPS connects when given URL and API Key.

Current Behavior

Run command:

Connect-SnipeitPS -URL 'http://inventory.domain.org' -apiKey 'base64:verylongkey'

Error:

Invoke-SnipeitMethod : Cannot connect to Snipe It: Unauthorized. At C:\Program Files\WindowsPowerShell\Modules\SnipeitPS\1.10.222\Private\Test-SnipeitPSConnection.ps1:10 char:16

Cannot verify connection to snipe it. For the start try to check url and provided apikey or credential parameters At C:\Program Files\WindowsPowerShell\Modules\SnipeitPS\1.10.222\Public\Connect-SnipeitPS.ps1:94 char:13

Possible Solution

Unknown if it is related to not having HTTPS.

Steps to Reproduce (for bugs)

reardonp-fps commented 2 years ago

I was dumb and was using the app key, not the API key. Sorry D: