// trigger the callbacks subscribe to the login event
LoginSubscriptionManagerServiceImpl loginSubscriptionManagerServiceImpl = CarbonServicesServiceComponent
.getLoginSubscriptionManagerServiceImpl();
UserRegistry configRegistry = CarbonServicesServiceComponent.getRegistryService()
.getConfigSystemRegistry(tenantId);
loginSubscriptionManagerServiceImpl.triggerEvent(configRegistry, username, tenantId);
if (log.isDebugEnabled()) {
log.debug("User Registry instance is set in the session for user " + username);
}
LoginAttempt loginAttempt = new LoginAttempt(username, tenantId, remoteAddress, new Date(),