python-social-auth / social-core

Python Social Auth - Core
BSD 3-Clause "New" or "Revised" License
842 stars 542 forks source link

Displaying user-friendly titles for available backends #680

Open jeremystretch opened 2 years ago

jeremystretch commented 2 years ago

Expected behaviour

I'm trying to devise a way of conveying a user-friendly name for each of the backends, so that when displaying links on a login page I can present an available backend to the user as e.g. "Microsoft Azure AD" instead of "azuread-oauth2".

Actual behaviour

This doesn't appear to be defined on the individual backends anywhere. (I couldn't find any existing issues relating to this; apologies if I missed something.)

What are the steps to reproduce this issue?

N/A

Any logs, error output, etc?

N/A

Any other comments?

My approach to enabling this would be to add an (optional) title attribute to each class, which can be easily referenced for display. For now, I'm maintaining a separate dictionary mapping backend names to titles, but figured this would make sense to implement upstream.

I'm happy to volunteer for this work if it's desired.

nijel commented 2 years ago

We do this as well, including icons: https://github.com/WeblateOrg/weblate/blob/53d5358b4fd798037cb9248b06c06618c84eaf20/weblate/accounts/templatetags/authnames.py#L29-L52