diff --git a/gateway/src/main/java/org/georchestra/gateway/accounts/events/rabbitmq/RabbitmqAccountCreatedEventSender.java b/gateway/src/main/java/org/georchestra/gateway/accounts/events/rabbitmq/RabbitmqAccountCreatedEventSender.java index f64ae41f..abae6ecf 100644 --- a/gateway/src/main/java/org/georchestra/gateway/accounts/events/rabbitmq/RabbitmqAccountCreatedEventSender.java +++ b/gateway/src/main/java/org/georchestra/gateway/accounts/events/rabbitmq/RabbitmqAccountCreatedEventSender.java @@ -48,19 +48,22 @@ public void on(AccountCreated event) { if (null != oAuth2ProviderId) { String fullName = user.getFirstName() + " " + user.getLastName(); String email = user.getEmail(); - String provider = oAuth2ProviderId; - sendNewOAuthAccountMessage(fullName, email, provider); + String organization = user.getOrganization(); + String[] providerFields = oAuth2ProviderId.split(";"); + sendNewOAuthAccountMessage(fullName, email, organization, providerFields[0], providerFields[1]); } } - public void sendNewOAuthAccountMessage(String fullName, String email, String provider) { + public void sendNewOAuthAccountMessage(String fullName, String email, String organization, String providerName, String providerUid) { // beans getting a reference to the sender JSONObject jsonObj = new JSONObject(); jsonObj.put("uid", UUID.randomUUID()); jsonObj.put("subject", OAUTH2_ACCOUNT_CREATION); jsonObj.put("username", fullName); // bean jsonObj.put("email", email); // bean - jsonObj.put("provider", provider); // bean + jsonObj.put("organization", organization); // bean + jsonObj.put("providerName", providerName); + jsonObj.put("providerUid", providerUid); eventTemplate.convertAndSend("routing-gateway", jsonObj.toString());// send } } \ No newline at end of file