Identityserver4.admin: Avatar is Non editable

Created on 14 Jan 2020  路  12Comments  路  Source: skoruba/IdentityServer4.Admin

First of all, this project is really excellent. I've been using it for a long time
There is a small problem,Avatar is Non editable,When editing personal information

medium task

Most helpful comment

We can add some input for profile picture url

In addition, we could offer file upload and set the claim value to the URL of the uploaded file. I think that might work and provide nice UX (no need to self host the picture or use a service which allows hot linking images)

All 12 comments

@gnsilence - Thanks for your feedback - this is great idea - I think @aiscrim something similar did in the branch with windows auth. I will add this feature in the future.

BTW: Avatar is currently connected to https://en.gravatar.com/ - @gnsilence

What I did was substituting the gravatar image with the picture coming from Active Directory, but I didn't give the user the option to change it. That would be a valuable new feature indeed.

@gnsilence - Do you want to upload file or post URL for image?
@TomasHubelbauer - Any idea about profile picture?
Thanks!

We can add some input for profile picture url, which is stored in claim like oidc specs says.

I think there could be a flow where if AD is used and the picture is present, take that, if not and the user uploaded a picture file, use that and if not then fallback to Gravatar. That way if you're in AD, it is authoritative, which is most likely what's intended and to change your picture you can talk to your AD admin and if you're not, you can switch between your own picture and the Gravatar one by either uploading or clearing your own picture.

We can add some input for profile picture url

In addition, we could offer file upload and set the claim value to the URL of the uploaded file. I think that might work and provide nice UX (no need to self host the picture or use a service which allows hot linking images)

@TomasHubelbauer Totally agree with you. In the AD scenario I am storing as picture claim the data URI (base64) representation of the picture, which could be an alternative too for the general picture upload. If we go for the hosted pictures instead, then it's probably a good idea to also change the AD picture saving accordingly.

@gnsilence - Do you want to upload file or post URL for image?
@TomasHubelbauer - Any idea about profile picture?
Thanks!

I have two options in mind:

  1. The avatar is uploaded to the system and then saved URL through adminapi
  2. Users upload pictures locally
    The first way is too coupled.
    Third party login avatar is not necessary, because there are many ways for the third party login, I think the simplest and most effective is to let the user upload the local, the user's information is maintained by the user as far as possible.
    and the less ways to maintain the user's information, the better.

Just to have my two cents. If we are allowing image uploads, there should probably be a Config option that allows you to disable them.

But regardless, I would like it if the Gravitar fallback to remained. Just to provide the option. In fact, this could even just be a Config item that lets you specify Image Upload, Gravitar or AD

Just to have my two cents. If we are allowing image uploads, there should probably be a Config option that allows you to disable them.

But regardless, I would like it if the Gravitar fallback to remained. Just to provide the option. In fact, this could even just be a Config item that lets you specify Image Upload, Gravitar or AD

That's a good idea

Hey, guys,
Thanks for you great efforts. Because I was striving to have a Identity Service instance recently, too.
And I tried to integrated a Cropper.js front end library to preview and crop the loaded picture as avatar.
A primitive demo here:
https://auth.prime-minister.pub/
You can use _Email:[email protected]_, _Password:@WSX2wsx_ to login and have a trying to edit the Avatar.

Basically, the site allow the user to upload image locally at 200KB size, then preview, crop, supress and saved locally, with a hash string to name the supressed pic, and a new identity claim keeping the hash string to connect the identity entity for occasions need to get.
Of course, older hash string and pic will be replaced when user update their new avatar.

Hope the similar function can be integrated into that.
I can share the code, too. But my coding skill really suck, hahahaha.

BTW, I prefer the solution to save user avatar in a local directory, too.

image

Was this page helpful?
0 / 5 - 0 ratings