-
Notifications
You must be signed in to change notification settings - Fork 46
Description
When using token exchange with the user_profile parameter, the firstName and lastName are correctly saved to Keycloak, but the email field is not being stored.
Environment:
Extension version: 1.16.0
Keycloak version: 26.3.0
Token exchange method: ID token
Steps to Reproduce:
Configure Apple Identity Provider in Keycloak
Make a token exchange request with user_profile parameter:
POST /realms/{realm}/protocol/openid-connect/token
Content-Type: application/x-www-form-urlencoded
grant_type=urn:ietf:params:oauth:grant-type:token-exchange
&client_id=my-client
&subject_token={apple_id_token}
&subject_issuer=apple
&subject_token_type=urn:ietf:params:oauth:token-type:id_token
&user_profile={"name":{"firstName":"John","lastName":"Doe"},"email":"john@example.com"}
Check the created user in Keycloak database
Expected Behavior:
User should be created with:
first_name: "John"
last_name: "Doe"
email: "john@example.com"
Actual Behavior:
User is created with:
first_name: "John" ✅
last_name: "Doe" ✅
email: NULL ❌
Database Verification:
sqlSELECT username, email, first_name, last_name
FROM user_entity
WHERE username = '{apple_user_id}';
Result:
| username | first_name | last_name | |
|---|---|---|---|
| 001251.874d1792f37642918f6400e98fa3b8aa.1010 | John | Doe | |
| Additional Notes: |
The token exchange succeeds and returns a valid access token
The returned access token contains given_name and family_name but does NOT contain the email claim
According to the documentation, the user_profile parameter should include email: {"name":{"firstName":string,"lastName":string},"email":string}
This appears to be a bug where the extension processes firstName/lastName from user_profile but ignores the email field