Git Product home page Git Product logo

Comments (7)

MrMontesa avatar MrMontesa commented on August 23, 2024

It clearly sais "unauthorized". So something is wrong in auth.
In my scripts I mainly use Set-Info to set the auth and be able to skip the overhead when pulling data from snipe.
Eg:

# Set connection details for Snipe-IT
Set-Info -URL $config.url -apiKey $config.apikey
# get all the Snipe Users into an array
$SnipeitUsers = Get-User -limit 1000

from snipeitps.

Shadowwolfing avatar Shadowwolfing commented on August 23, 2024

Correct, but i'm not sure what to look for when it's unauthorized.

from snipeitps.

MrMontesa avatar MrMontesa commented on August 23, 2024

What error message do you receive when running Set-Info? make sure your API token is not cut. My one is extremely long and contains characters the "double-click to copy" feature will stop copying.
Alternatively I can only imagine youre querying something you're not permission#ed to. E.g. an asset for another company, etc.
Good luck

from snipeitps.

Shadowwolfing avatar Shadowwolfing commented on August 23, 2024

Set-Info i don't have any errors. I have made sure to copy the complete key, multiple different ways. I am a SuperUser, which i have also created a API Token from the original administrator account and neither has worked.
All i am trying to do is Get-User command at this point, but clearly it something to do with API Token permissions, I just don't know where else to look.

Example:
$apikey = 'Very Long API Token'
$url = "http://snipeit/"
Set-Info -url $url -apiKey $apikey
Get-User -search "shadowwolfing"

I have also tried not using variables and input the website and key directly into Set-Info

Any other suggestions?
Thank you for taking time MrMontesa

from snipeitps.

PetriAsi avatar PetriAsi commented on August 23, 2024

@Shadowwolfing Are you using https?
And just to be sure, can you confirm that you are using your own snipeit url instead of "http://snipeit/" ?

from snipeitps.

PetriAsi avatar PetriAsi commented on August 23, 2024

And are you using self signed certificates?

from snipeitps.

PetriAsi avatar PetriAsi commented on August 23, 2024

Closing this for inactivity. Reopen if needed.

from snipeitps.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.