Add oidc to auth backends to clean up the display #8992

Closed
opened 2025-12-29 20:43:56 +01:00 by adam · 7 comments
Owner

Originally created by @DanSheps on GitHub (Dec 21, 2023).

Originally assigned to: @abhi1693 on GitHub.

Proposed Changes

Add:

    'oidc': ('OpenID Connect', None),

to the AUTH_BACKEND_ATTRS in netbox/netbox/authentication.py

Justification

Currently, the social auth displays the various SSO options under the login page. This uses the dict "AUTH_BACKEND_ATTRS" to translate the driver name (google-openidconnect for example) to a more user friendly name "Google".

Currently "oidc" is missing from this dict, which is the very basic level of openidconnect and if you need to connect to a non-listed driver when setting up social-auth it simply displays the driver name (oidc) instead of a more user friendly name,

Originally created by @DanSheps on GitHub (Dec 21, 2023). Originally assigned to: @abhi1693 on GitHub. ### Proposed Changes Add: ``` 'oidc': ('OpenID Connect', None), ``` to the `AUTH_BACKEND_ATTRS` in netbox/netbox/authentication.py ### Justification Currently, the social auth displays the various SSO options under the login page. This uses the dict "AUTH_BACKEND_ATTRS" to translate the driver name (google-openidconnect for example) to a more user friendly name "Google". Currently "oidc" is missing from this dict, which is the very basic level of openidconnect and if you need to connect to a non-listed driver when setting up social-auth it simply displays the driver name (oidc) instead of a more user friendly name,
adam added the status: acceptedtype: feature labels 2025-12-29 20:43:56 +01:00
adam closed this issue 2025-12-29 20:43:56 +01:00
Author
Owner

@llamafilm commented on GitHub (Jan 4, 2024):

Can we also have a way to customize the displayed text? My organization uses a custom identity provider so I'd like to use that name instead of OpenID Connect.

Screenshot 2024-01-04 at 1 34 52 PM
@llamafilm commented on GitHub (Jan 4, 2024): Can we also have a way to customize the displayed text? My organization uses a custom identity provider so I'd like to use that name instead of `OpenID Connect`. <img width="373" alt="Screenshot 2024-01-04 at 1 34 52 PM" src="https://github.com/netbox-community/netbox/assets/3991046/8d0a39a1-9017-427a-bd40-ee75e350b731">
Author
Owner

@alehaa commented on GitHub (Jan 5, 2024):

I would also prefer this, as some of our users don‘t know what a keycloak login is and some of our applications already use a term like „login by company ID“.

Maybe a simple solution to these issues is to make AUTH_BACKEND_ATTRS configurable by admins?

@alehaa commented on GitHub (Jan 5, 2024): I would also prefer this, as some of our users don‘t know what a keycloak login is and some of our applications already use a term like „login by company ID“. Maybe a simple solution to these issues is to make `AUTH_BACKEND_ATTRS` configurable by admins?
Author
Owner

@llamafilm commented on GitHub (Jan 5, 2024):

I would suggest a new config option called REMOTE_AUTH_NAME which would apply to any social auth backend, where the user can enter any custom string. If this option is missing, then use a sane default as @DanSheps described above.

@llamafilm commented on GitHub (Jan 5, 2024): I would suggest a new config option called `REMOTE_AUTH_NAME` which would apply to any social auth backend, where the user can enter any custom string. If this option is missing, then use a sane default as @DanSheps described above.
Author
Owner

@llamafilm commented on GitHub (Jan 7, 2024):

I made these 2 fixes in my own fork. I'd be happy to submit a PR if this is accepted. https://github.com/netbox-community/netbox/compare/develop...llamafilm:netbox:develop
Screenshot 2024-01-06 at 3 32 52 PM

@llamafilm commented on GitHub (Jan 7, 2024): I made these 2 fixes in my own fork. I'd be happy to submit a PR if this is accepted. https://github.com/netbox-community/netbox/compare/develop...llamafilm:netbox:develop <img width="364" alt="Screenshot 2024-01-06 at 3 32 52 PM" src="https://github.com/netbox-community/netbox/assets/3991046/37797649-902b-43d7-bb0c-984f8bd04b94">
Author
Owner

@DanSheps commented on GitHub (Jan 9, 2024):

I would suggest a new config option called REMOTE_AUTH_NAME which would apply to any social auth backend, where the user can enter any custom string. If this option is missing, then use a sane default as @DanSheps described above.

I don't think we would go with "REMOTE_AUTH_NAME" as you could enable more then 1 SSO provider that might be missing details and need to provide data. It might also be useful to be able to override provided defaults (maintainers will need to discuss)

@DanSheps commented on GitHub (Jan 9, 2024): > I would suggest a new config option called `REMOTE_AUTH_NAME` which would apply to any social auth backend, where the user can enter any custom string. If this option is missing, then use a sane default as @DanSheps described above. I don't think we would go with "REMOTE_AUTH_NAME" as you could enable more then 1 SSO provider that might be missing details and need to provide data. It might also be useful to be able to override provided defaults (maintainers will need to discuss)
Author
Owner

@llamafilm commented on GitHub (Jan 11, 2024):

How would it be possible to enable more than one SSO provider? From what I can tell, REMOTE_AUTH_BACKEND is a single string? In my fork I actually called it REMOTE_AUTH_DISPLAYNAME for more clarity.

@llamafilm commented on GitHub (Jan 11, 2024): How would it be possible to enable more than one SSO provider? From what I can tell, `REMOTE_AUTH_BACKEND` is a single string? In my fork I actually called it `REMOTE_AUTH_DISPLAYNAME` for more clarity.
Author
Owner

@EHRETic commented on GitHub (Jan 21, 2024):

I'll just upvote the possibility to have a nice OIDC button (same style as normal "sign in" button) with a custom label 😉

Like Portainer in fact:
image

@EHRETic commented on GitHub (Jan 21, 2024): I'll just upvote the possibility to have a nice OIDC button (same style as normal "sign in" button) with a custom label 😉 Like Portainer in fact: ![image](https://github.com/netbox-community/netbox/assets/28634810/535f7bef-3ff8-4a73-96cf-4b24e51cac1e)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8992