
Both the admin and account consoles allow use of an avatar to personalize the user experience. Keycloak supports avatars using the oidc standard picture
claim.
This picture
claim should have a URI as its value. The URI should point to the avatar meant to be displayed in the masthead section of the admin console or account console.
The simplest way to allow users to specify the avatar URI is to add a picture
attribute in User profile. Just go to the admin console and navigate to the Realm Settings → User profile
tab.
Here is an example setup of the picture
attribute:
Here is the result in account console once the URI is saved for the picture attribute:
Allowing users to specify their own URI could lead to security concerns. An avatar can contain malware. So ensure that images come from a trusted source. One practical approach is to make sure that the picture has a regular expression validator to restrict the URI.
|