GraphQL authentication is not available when LOGIN_REQUIRED is true #9849

Closed
opened 2025-12-29 21:23:30 +01:00 by adam · 1 comment
Owner

Originally created by @antoinekh on GitHub (Jun 14, 2024).

Deployment Type

Self-hosted

NetBox Version

4.0.5

Python Version

3.10

Steps to Reproduce

  1. Set LOGIN_REQUIRED to true in the Netbox configuration
  2. Try to make a graphql request with TOKEN auth

This is similar to this BUG from the past for API auth
https://github.com/netbox-community/netbox/issues/724

Expected Behavior

Able to go to /graphql to be able to make request with auth with TOKEN

Observed Behavior

Redirect to login page

<!DOCTYPE html>
<html
  lang="en"
  data-netbox-url-name="login"
  data-netbox-base-path=""
  >
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width, viewport-fit=cover" />
    <meta name="htmx-config" content='{"scrollBehavior": "auto"}'>

    
    <title>Home | NetBox</title>
Originally created by @antoinekh on GitHub (Jun 14, 2024). ### Deployment Type Self-hosted ### NetBox Version 4.0.5 ### Python Version 3.10 ### Steps to Reproduce 1. Set LOGIN_REQUIRED to true in the Netbox configuration 2. Try to make a graphql request with TOKEN auth This is similar to this BUG from the past for API auth https://github.com/netbox-community/netbox/issues/724 ### Expected Behavior Able to go to /graphql to be able to make request with auth with TOKEN ### Observed Behavior Redirect to login page ``` <!DOCTYPE html> <html lang="en" data-netbox-url-name="login" data-netbox-base-path="" > <head> <meta charset="UTF-8" /> <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width, viewport-fit=cover" /> <meta name="htmx-config" content='{"scrollBehavior": "auto"}'> <title>Home | NetBox</title> ````
adam closed this issue 2025-12-29 21:23:31 +01:00
Author
Owner

@antoinekh commented on GitHub (Jun 14, 2024):

It was a mistake in my environment.
It’s already implemented with middleware and settings.AUTH_EXEMPT_PATHS

sorry for the lost of time

@antoinekh commented on GitHub (Jun 14, 2024): It was a mistake in my environment. It’s already implemented with middleware and settings.AUTH_EXEMPT_PATHS sorry for the lost of time
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9849