Java SDK- login attribute value is resetting to email value when user trying to update email

When try the below, its updating login attribute value with email. I have tried using both java object and rest endpoint. In both cases its updating login value along with email.
Is it real bug in Okta?

with below code its updating both login and email attributes with “test123@test.example.com”, which is not expected.

client = Clients.builder()
.setOrgUrl("${yourOktaDomain}")
.setClientId("{}")
.setClientCredentials(cc)
.build();
User user = client.getUser(userId);
UserProfile up = user.getProfile();
up.setEmail(“test123@test.example.com”);
user.setProfile(up);
user.update();
================================
Curl Command:

curl -v -X POST
-H “Accept: application/json”
-H “Content-Type: application/json”
-H “Authorization: SSWS ${api_token}”
-d ‘{
“profile”: {
“firstName”: “santhi”,
“email”: “test123@test.example.com”,
“mobilePhone”: “555-415-1337”
}
}’ “https://${yourOktaDomain}/api/v1/users/{okta-id}”


Please let me know if anyone seen it and if have any workaround.

Do you have Self-Service Registration enabled in your tenant? If so, the login and email values for all users in your Okta org will be set to the same value during creation/update.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.