Skip to content
Permalink
Browse files Browse the repository at this point in the history
KEYCLOAK-10780 Stop creating placeholder e-mails for service accounts (
  • Loading branch information
sguilhen authored and stianst committed Nov 15, 2019
1 parent 43e2370 commit 9a7c1a9
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion examples/demo-template/testrealm.json
Expand Up @@ -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" ]
}
Expand Down
Expand Up @@ -164,7 +164,6 @@ public void enableServiceAccount(ClientModel client) {
// 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());
}

Expand Down Expand Up @@ -205,7 +204,6 @@ public void clientIdChanged(ClientModel client, String newClientId) {
if (serviceAccountUser != null) {
String username = ServiceAccountConstants.SERVICE_ACCOUNT_USER_PREFIX + newClientId;
serviceAccountUser.setUsername(username);
serviceAccountUser.setEmail(username + "@placeholder.org");
}
}

Expand Down
Expand Up @@ -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"]
Expand Down
Expand Up @@ -231,6 +231,8 @@ public void serviceAccount() {
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
Expand Down

0 comments on commit 9a7c1a9

Please sign in to comment.