Configurable Logout URL #6929

Closed
opened 2025-12-29 19:46:53 +01:00 by adam · 7 comments
Owner

Originally created by @fionera on GitHub (Sep 3, 2022).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.3.2

Feature type

New functionality

Proposed functionality

I'd like to have a configuration option to set a custom URL for the Logout Button in Netbox.

As example a config parameter REMOTE_AUTH_LOGOUT which gets set to the URL of the Logout-Endpoint.

The original Issue #9316 was closed and locked and I just dont understand why. This doesnt help in any way since I now had to make a copy of this issue.

Use case

I'm using Authentik and OAuth2-Proxy for authentication. This means Netbox is protected by a reverse proxy that handles authentication and hands over the logged in user to Netbox via an HTTP header, configured by the Netbox option REMOTE_AUTH_HEADER.

When clicking "Logout" in Netbox Menu nothing happens because no logout in Authentik is made and I'm immediatly re-logged-in in Netbox (the HTTP header set by the reverse proxy is still present because the session in Authentik is still active). To solve this problem a configurable Logout URL is needed, so the click on logout in netbox calls the sign_out URL of Authentik.

Perhaps the following docs can help to get a full picture of what I'm trying to achieve.

goauthentik.io/docs/providers/proxy
goauthentik.io/docs/providers/proxy/#logging-out
https://oauth2-proxy.github.io/oauth2-proxy/docs/features/endpoints#sign-out

Database changes

No response

External dependencies

No response

Originally created by @fionera on GitHub (Sep 3, 2022). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.3.2 ### Feature type New functionality ### Proposed functionality I'd like to have a configuration option to set a custom URL for the Logout Button in Netbox. As example a config parameter `REMOTE_AUTH_LOGOUT` which gets set to the URL of the Logout-Endpoint. The original Issue #9316 was closed and locked and I just dont understand why. This doesnt help in any way since I now had to make a copy of this issue. ### Use case I'm using Authentik and OAuth2-Proxy for authentication. This means Netbox is protected by a reverse proxy that handles authentication and hands over the logged in user to Netbox via an HTTP header, configured by the Netbox option `REMOTE_AUTH_HEADER`. When clicking "Logout" in Netbox Menu nothing happens because no logout in Authentik is made and I'm immediatly re-logged-in in Netbox (the HTTP header set by the reverse proxy is still present because the session in Authentik is still active). To solve this problem a configurable Logout URL is needed, so the click on logout in netbox calls the sign_out URL of Authentik. Perhaps the following docs can help to get a full picture of what I'm trying to achieve. goauthentik.io/docs/providers/proxy goauthentik.io/docs/providers/proxy/#logging-out https://oauth2-proxy.github.io/oauth2-proxy/docs/features/endpoints#sign-out ### Database changes _No response_ ### External dependencies _No response_
adam added the status: acceptedtype: feature labels 2025-12-29 19:46:53 +01:00
adam closed this issue 2025-12-29 19:46:54 +01:00
Author
Owner

@kkthxbye-code commented on GitHub (Sep 3, 2022):

I understand what you want to achieve and why. What I fail to see is why you are not just rewriting the logout URL in whatever webserver/reverse proxy you have before netbox.

Other alternative solutions include adding a custom logout URL to either the header or footer. You could even inject a small javascript snippet that changes the URL.

Personally I don't believe this is a netbox problem and I would rather avoid the clutter for a feature I can only assume will be very rarely used (I looked for other software with a custom logout URL but found basically nothing). I'll let the other maintainers decide, but wanted to give my opinion.

@kkthxbye-code commented on GitHub (Sep 3, 2022): I understand what you want to achieve and why. What I fail to see is why you are not just rewriting the logout URL in whatever webserver/reverse proxy you have before netbox. Other alternative solutions include adding a custom logout URL to either the [header](https://demo.netbox.dev/static/docs/configuration/miscellaneous/#banner_top) or [footer](https://demo.netbox.dev/static/docs/configuration/miscellaneous/#banner_bottom). You could even inject a small javascript snippet that changes the URL. Personally I don't believe this is a netbox problem and I would rather avoid the clutter for a feature I can only assume will be very rarely used (I looked for other software with a custom logout URL but found basically nothing). I'll let the other maintainers decide, but wanted to give my opinion.
Author
Owner

@fionera commented on GitHub (Sep 4, 2022):

Because I also have to logout in Netbox itself. If I just override the logout url, the user isnt logged in via OAuth2 but still in Netbox. This probably wont be an issue since Netbox will directly use the new Header, but I have to test that.

@fionera commented on GitHub (Sep 4, 2022): Because I also have to logout in Netbox itself. If I just override the logout url, the user isnt logged in via OAuth2 but still in Netbox. This probably wont be an issue since Netbox will directly use the new Header, but I have to test that.
Author
Owner

@kkthxbye-code commented on GitHub (Sep 4, 2022):

Because I also have to logout in Netbox itself. If I just override the logout url, the user isnt logged in via OAuth2 but still in Netbox. This probably wont be an issue since Netbox will directly use the new Header, but I have to test that.

Could you please amend the issue with the exact requested functionality then. Because just making the logout URL configurable will have the same issue. Sounds like you want a configurable redirect URL after logout like the django LOGOUT_REDIRECT_URL setting. I think we have our own logout view so I don't think it works out of the box though.

@kkthxbye-code commented on GitHub (Sep 4, 2022): > Because I also have to logout in Netbox itself. If I just override the logout url, the user isnt logged in via OAuth2 but still in Netbox. This probably wont be an issue since Netbox will directly use the new Header, but I have to test that. Could you please amend the issue with the exact requested functionality then. Because just making the logout URL configurable will have the same issue. Sounds like you want a configurable redirect URL after logout like the django LOGOUT_REDIRECT_URL setting. I think we have our own logout view so I don't think it works out of the box though.
Author
Owner

@jeremystretch commented on GitHub (Sep 6, 2022):

The original Issue https://github.com/netbox-community/netbox/issues/9316 was closed and locked and I just dont understand why.

Per my comment here, the OP was asked to provide more detail but opted not to, so no further progress was made on the issue.

@jeremystretch commented on GitHub (Sep 6, 2022): > The original Issue https://github.com/netbox-community/netbox/issues/9316 was closed and locked and I just dont understand why. Per my comment [here](https://github.com/netbox-community/netbox/issues/9316#issuecomment-1142070885), the OP was asked to provide more detail but opted not to, so no further progress was made on the issue.
Author
Owner

@fionera commented on GitHub (Sep 10, 2022):

LOGOUT_REDIRECT_URL sounds like a good description. I want to either logout from Netbox and redirect to a specific url or override the logout button to be a custom url with the netbox logout url as redirect parameter ( eg. /oauth/logout?redirect=NETBOX_HANDLER )

@fionera commented on GitHub (Sep 10, 2022): LOGOUT_REDIRECT_URL sounds like a good description. I want to either logout from Netbox and redirect to a specific url or override the logout button to be a custom url with the netbox logout url as redirect parameter ( eg. /oauth/logout?redirect=NETBOX_HANDLER )
Author
Owner

@jsenecal commented on GitHub (Sep 12, 2022):

Relevant Django approach: dcee1dfc79

@jsenecal commented on GitHub (Sep 12, 2022): Relevant Django approach: https://github.com/django/django/commit/dcee1dfc798bbf4602a35fb73f6acade9f5fd630
Author
Owner

@github-actions[bot] commented on GitHub (Nov 12, 2022):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Nov 12, 2022): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6929