Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avatar via OIDC Provider #202

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Avatar via OIDC Provider #202

wants to merge 4 commits into from

Conversation

Estyms
Copy link

@Estyms Estyms commented Aug 4, 2024

Description

I've added a config field to the OIDC provider that can set the avatar of a user based on a URL template that can use Claim Types as values.

If the field is empty, the behavior is the same as it was, meaning the current avatar set by the user is kept as is.
If the field is filled, then each time a user connects with OIDC, the user avatar is updated.

Examples

Typical

If the oidc provider sends an avatar_url claim type, we can then set the AvatarURLFormat as @{avatar_url}

image

Advanced

If we use a discord linked provider that provides a discord_id and an avatar claim type, we can then set the AvatarURLFormat as https://cdn.discordapp.com/avatars/@{discord_id}/@{avatar}.jpg?size=512

image

Limitations

If multiple claims exists with the same claim type, only the first one will be applied to the AvatarURLFormat

Bug fixes

  • Text and JSON fields can now be emptied.

- Avatar Url Format Explanation
- Mimetype is now inferred by the Response header.
- Extension is now derived from the Mimetype
@Estyms
Copy link
Author

Estyms commented Aug 7, 2024

I've seen those curious eyes 👀

Joking apart, if you want me to change anything before merging do not hesitate!

@9p4
Copy link
Owner

9p4 commented Aug 7, 2024

I'm running some tests on my end, trying to make sure that everything is secure when loading the image.

@9p4
Copy link
Owner

9p4 commented Aug 19, 2024

Unfortunately, as cool as this is, I'll have to put it on the backburner for now, since college is starting back up and I don't have much time for maintaining and verifying big new features like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants