PrivilegedCarbonContext carbonContext = PrivilegedCarbonContext.getThreadLocalCarbonContext();
carbonContext.setTenantDomain(tenantDomain);
carbonContext.setTenantId(tenantId);
carbonContext.setUsername(username);
//populate the secuirtyContext of authenticated user
SecurityContext securityContext = new StratosSecurityContext(username);
message.put(SecurityContext.class, securityContext);
// set the authenticated flag and let the request to continue
AuthenticationContext.setAuthenticated(true);
if (log.isDebugEnabled()) {