Skip to content

Conversation

@tobast
Copy link
Contributor

@tobast tobast commented Jun 26, 2024

Fixes: #15375 -- allows a user to customize the display aspect of social login providers (SSO and such).

This PR is separated into two commits on purpose.

The first one fixes #15375 and adds relevant documentation. Users may specify in their configuration SOCIAL_AUTH_BACKEND_ATTRS, which override the display name of a social login provider, based on the name attribute of the REMOTE_AUTH_BACKEND class.

The second one allows to use an arbitrary URL as the identity provider's image. Using mdi icons works well for eg. Github social auth, but does not allow for corporate branding of an internal SSO (which is often expected by users).


icon_name = None
icon_img = None
if '://' in icon_source:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will raise an exception if icon_source is None. It should probably be:

if icon_source and '://' in icon_source:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, indeed. Patched in my amended commit.

@jerrykan
Copy link

jerrykan commented Jul 3, 2024

I've tested this with a patched v4.0.6 instance and it seems to do the job (ignoring the one bug related to icon_source). Adding support for external images is a nice addition as well.

It would be good to see this merged.

@tobast tobast force-pushed the tbastian/custom_idp_name branch from 5a17893 to 23beda5 Compare July 3, 2024 06:26
@jeremystretch jeremystretch requested a review from arthanson July 8, 2024 14:38
Copy link
Collaborator

@arthanson arthanson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great!
Home | NetBox 2024-07-10 12-41-44

@arthanson arthanson merged commit 4ca1494 into netbox-community:develop Jul 10, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow for custom names for Identity Provider text in the Login link

3 participants