KEYCLOAK-10780 Stop creating placeholder e-mails for service accounts (#228)

This commit is contained in:
Stefan Guilhen 2019-10-25 11:46:27 -03:00 committed by Stian Thorgersen
parent 43e2370f21
commit 9a7c1a91a5
4 changed files with 2 additions and 4 deletions

View file

@ -76,7 +76,6 @@
{
"username" : "service-account-product-sa-client",
"enabled": true,
"email" : "service-account-product-sa-client@placeholder.org",
"serviceAccountClientId": "product-sa-client",
"realmRoles": [ "user" ]
}

View file

@ -164,7 +164,6 @@ public class ClientManager {
// Don't use federation for service account user
UserModel user = realmManager.getSession().userLocalStorage().addUser(client.getRealm(), username);
user.setEnabled(true);
user.setEmail(username + "@placeholder.org");
user.setServiceAccountClientLink(client.getId());
}
@ -205,7 +204,6 @@ public class ClientManager {
if (serviceAccountUser != null) {
String username = ServiceAccountConstants.SERVICE_ACCOUNT_USER_PREFIX + newClientId;
serviceAccountUser.setUsername(username);
serviceAccountUser.setEmail(username + "@placeholder.org");
}
}

View file

@ -111,7 +111,6 @@
{
"username": "service-account-photoz-restful-api",
"enabled": true,
"email": "service-account-photoz-restful-api@placeholder.org",
"serviceAccountClientId": "photoz-restful-api",
"clientRoles": {
"photoz-restful-api" : ["uma_protection"]

View file

@ -231,6 +231,8 @@ public class ClientTest extends AbstractAdminTest {
response.close();
UserRepresentation userRep = realm.clients().get(id).getServiceAccountUser();
assertEquals("service-account-serviceclient", userRep.getUsername());
// KEYCLOAK-11197 service accounts are no longer created with a placeholder e-mail.
assertNull(userRep.getEmail());
}
// KEYCLOAK-3421