Netbox API 2.0 - Auth #948

Closed
opened 2025-12-29 16:27:10 +01:00 by adam · 1 comment
Owner

Originally created by @InsaneSplash on GitHub (May 14, 2017).

Is basic auth still supported with the new Netbox API v2.0?

I am able to auth using a token, but not using a basic user/pass.

curl --user netbox:netbox -ik http://netbox:netbox@netbox/api/dcim/devices/?format=json
HTTP/1.1 403 Forbidden
Server: nginx/1.10.0 (Ubuntu)
Date: Sun, 14 May 2017 15:26:06 GMT
Content-Type: application/json
Content-Length: 58
Connection: keep-alive
Vary: Accept, Cookie
Allow: GET, POST, OPTIONS
API-Version: 2.0
X-Frame-Options: SAMEORIGIN

{"detail":"Authentication credentials were not provided."}
curl -H "Authorization: Token XXXXXXXXX" -ik http://netbox/api/dcim/devices/?format=json
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0HTTP/1.1 200 OK
Server: nginx/1.10.0 (Ubuntu)
Date: Sun, 14 May 2017 15:27:08 GMT
Content-Type: application/json
Content-Length: 68384
Connection: keep-alive
Vary: Accept, Cookie
Allow: GET, POST, OPTIONS
API-Version: 2.0
X-Frame-Options: SAMEORIGIN

{"count":1591,"next":"http://netbox.eoh-ns.net/api/dcim/devices/?format=json&l..............

Originally created by @InsaneSplash on GitHub (May 14, 2017). Is basic auth still supported with the new Netbox API v2.0? I am able to auth using a token, but not using a basic user/pass. ``` curl --user netbox:netbox -ik http://netbox:netbox@netbox/api/dcim/devices/?format=json HTTP/1.1 403 Forbidden Server: nginx/1.10.0 (Ubuntu) Date: Sun, 14 May 2017 15:26:06 GMT Content-Type: application/json Content-Length: 58 Connection: keep-alive Vary: Accept, Cookie Allow: GET, POST, OPTIONS API-Version: 2.0 X-Frame-Options: SAMEORIGIN {"detail":"Authentication credentials were not provided."} ``` ``` curl -H "Authorization: Token XXXXXXXXX" -ik http://netbox/api/dcim/devices/?format=json 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0HTTP/1.1 200 OK Server: nginx/1.10.0 (Ubuntu) Date: Sun, 14 May 2017 15:27:08 GMT Content-Type: application/json Content-Length: 68384 Connection: keep-alive Vary: Accept, Cookie Allow: GET, POST, OPTIONS API-Version: 2.0 X-Frame-Options: SAMEORIGIN {"count":1591,"next":"http://netbox.eoh-ns.net/api/dcim/devices/?format=json&l.............. ```
adam closed this issue 2025-12-29 16:27:10 +01:00
Author
Owner

@jeremystretch commented on GitHub (May 15, 2017):

API 2.0 supports only token and session authentication. Basic authentication is no longer supported.

(In the future, please avoid opening GitHub issues for questions; these are reserved for feature requests and bug reports. General discussion should be held on the mailing list.)

@jeremystretch commented on GitHub (May 15, 2017): API 2.0 supports only token and session authentication. Basic authentication is no longer supported. (In the future, please avoid opening GitHub issues for questions; these are reserved for feature requests and bug reports. General discussion should be held on the [mailing list](https://groups.google.com/forum/#!forum/netbox-discuss).)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#948