Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.
If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!
API request Unauthorized on Windows
-
"Fresh" installation on Windows server.
ProGet v.2024.32I'm trying to make simple API request.
curl -v --header "X-ApiKey: ******* " http://******:8624/api/json/Security_GetPrivilegesResponse:
- Trying ****:8624...
- Connected to ******* port 8624 (#0)
GET /api/json/Security_GetPrivileges HTTP/1.1
Host: *****:8624
User-Agent: curl/7.84.0
Accept: /
X-ApiKey: *******- Mark bundle as not supporting multiuse
< HTTP/1.1 401 Unauthorized
If I run ProGet on Linux (docker), the response on the same request is:
Connected to ********* port 8080 (#0)GET /api/json/Security_GetPrivileges HTTP/1.1
Host: ******:8080
User-Agent: curl/7.84.0
Accept: /
X-ApiKey: ********- Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
Where is the problem?
-
Hi @michal-roszak_0767 ,
The first thing that comes to mind is WIndows Integrated Authentication.
Curl does not support that, but if you use PowerShell wtih --UseDefaultCredentials it will. You can also bypass the request by appending
?bypassIntegrated=false
to the URL.Cheers,
Alana
-
-
Why you don't recommend using API?
I've seen a lot of forum threads on this topic and people seem to be using it.Regards,
Michal
-
Hi @michal-roszak_0767 ,
I assume you mean, why don't we recommend using the Native API?
We don't recommend using the Native API because we do not document usage and the methods are subject to removal or change, even in maintenance versions.
In this case, we do not have an alternative API for getting security privileges, so the only option is
Security_GetPrivileges
if you want to do that programmatically.Thanks,
Alana
-
-
Hi @michal-roszak_0767 ,
We do not have a non-Native API to assign privleges at this time, but otherwise our documented APIs are here: https://docs.inedo.com/docs/proget/api
Here is the info about the Native API:
https://docs.inedo.com/docs/proget/api/http-requests#native-api-endpointsThanks,
Alana
-
Hi Alana,
Can I modify/set "Other Settings" section elements using pgutil?
In properties section I see only:
alternateNames=*not set* feedType=maven2 active=true dropPath=*not set* endpointUrl=http://******/maven2/MyNewMavenFeed/ connectors=*not set* canPublish=true vulnerabilitiesEnabled=true
Cheers,
Michal
-
@michal-roszak_0767 only what's shown there is currently supported.
I saw that @zs-dahe is is looking for a the RetentionActive setting as well (see https://forums.inedo.com/topic/5341/retention-activation-via-api), so it would probably easiest to do these at once: I'm almost certain this is done at the ProGet level, not pgutil.
Can you open a new thread w/ the requested fields/properties? This will make it much easier for people searching in the future :)
-