Using Avatars

Use avatars in the Admin console and Account console.

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.

Setting a picture attribute from the admin 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:

picture attribute general settings
User profile picture attribute setup in admin console

Avatar success

Here is the result in account console once the URI is saved for the picture attribute:

account console with avatar
Avatar shown in account console

Important warning

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.
avatar validation
RegExp validator for User profile picture attribute
On this page