keycloak/keycloak

Setting some attributes to multivalued causes 400 errors

Open

#42.749 aberto em 18 de set. de 2025

Ver no GitHub
 (2 comments) (1 reaction) (0 assignees)Java (8.346 forks)batch import
area/admin/apiarea/user-profilehelp wantedkind/bugpriority/normalstatus/auto-bumpteam/core-iamteam/core-shared

Métricas do repositório

Stars
 (34.398 stars)
Métricas de merge de PR
 (Mesclagem média 6d 19h) (384 fundiu PRs em 30d)

Description

Before reporting an issue

  • I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.

Area

admin/api

Describe the bug

In trying to get Keycloak to send verification and account recovery emails to multiple addresses I turned on multivalued for the email attribute.

After doing this, adding emails to an account causes a 400 error:

{"error":"unknown_error","error_description":"Cannot parse the JSON"}

In the debug logs I also see the following:

kc.sh[99219]: 2025-09-18 18:43:28,738 DEBUG [org.jboss.resteasy.reactive.server.handlers.RequestDeserializeHandler] (executor-thread-4) Error occurred during deserialization of input: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type `java.lang.String` from Array value (token `JsonToken.START_ARRAY`)
kc.sh[99219]:  at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 170] (through reference chain: org.keycloak.representations.idm.UserRepresentation["email"])

I assume this error means that somewhere the value for email is hardcoded as the type String.

Version

26.3.4

Regression

  • The issue is a regression

Expected behavior

Either the multivalued toggle is not present for attributes where it isn't supported, and/or functionality is expended to support multiple email addresses.

Actual behavior

Enabled multivalued for certain attributes causes an error.

How to Reproduce?

Enabled multivalued for email, or username, and try updating those fields in user info.

Anything else?

No response

Guia do colaborador