protected Profile createProfile(String tenant, Connection<?> connection, Profile userData) { try { ConnectionUtils.addConnectionData(userData, connection.createData(), textEncryptor); return profileService.createProfile(tenant, userData.getUsername(), null, userData.getEmail(), true, userData.getRoles(), userData.getAttributes(), null); } catch (CryptoException | ProfileException e) { throw new AuthenticationException("Unable to create profile of user '" + userData.getUsername() + "' in tenant '" + tenant + "'", e); } }