nb.version
Returns an Empty String Due to OIDC Proxy Configuration
#640
Labels
type: bug
A confirmed report of unexpected behavior in the application
pynetbox version
v7.4.0
NetBox version
v4.0.9
Python version
3.11
Steps to Reproduce
Description:
When using NetBox with an OIDC (OpenID Connect) proxy for authentication, the
nb.version
property consistently returns an empty string (''
). This issue arises because theget_version
method inpynetbox
does not receive theAPI-Version
header, as the request is redirected to the OIDC login page due to missing authorization.Steps to Reproduce:
Set up NetBox behind an OIDC proxy with the following Apache configuration:
Use pynetbox to access the API.
Call the
nb.version
property.Observe that
nb.version
returns an empty string.Expected Behavior:
The
nb.version
property should return the correct NetBox version string.Actual Behavior:
The
nb.version
property returns an empty string.Cause:
The OIDC proxy redirects unauthorized requests to the login page, causing the
get_version
method to miss theAPI-Version
header.Proposed Solution:
Modify the
version
property inpynetbox/core/api.py
to ensure the authorization token is passed to theget_version
method. Here's the proposed change:Additional Context:
The issue is specific to environments where NetBox is protected by an OIDC proxy, requiring a valid token for API access.
Expected Behavior
Observed Behavior
The text was updated successfully, but these errors were encountered: