/** * Gets logged in user of the server * * @return user name */ private String getLoggedInUser() { return CarbonContext.getThreadLocalCarbonContext().getUsername(); }
public StatusHolder(String type, String key, String version, String target, String targetAction, boolean success, String message) { this.type = type; this.key = key; this.user = CarbonContext.getThreadLocalCarbonContext().getUsername(); this.message = message; this.version = version; this.target = target; this.targetAction = targetAction; this.success = success; this.timeInstance = Long.toString(System.currentTimeMillis()); }
public StatusHolder(String type, String key, String version, String target, String targetAction, boolean success, String message) { this.type = type; this.key = key; this.user = CarbonContext.getThreadLocalCarbonContext().getUsername(); this.message = message; this.version = version; this.target = target; this.targetAction = targetAction; this.success = success; this.timeInstance = Long.toString(System.currentTimeMillis()); }
public StatusHolder(String type, String key, String version, String target, String targetAction) { this.type = type; this.key = key; this.version = version; this.target = target; this.targetAction = targetAction; this.user = CarbonContext.getThreadLocalCarbonContext().getUsername(); this.success = true; this.timeInstance = Long.toString(System.currentTimeMillis()); }
/** * Gets logged in user of the server * * @return user name */ private String getLoggedInUser() { return CarbonContext.getThreadLocalCarbonContext().getUsername(); }
public StatusHolder(String type, String key, String version, String target, String targetAction) { this.type = type; this.key = key; this.version = version; this.target = target; this.targetAction = targetAction; this.user = CarbonContext.getThreadLocalCarbonContext().getUsername(); this.success = true; this.timeInstance = Long.toString(System.currentTimeMillis()); }
/** * Returns all user claims which can be used in the identity recovery * process * such as the email address, telephone number etc * * @return * @throws IdentityMgtServiceException */ public UserIdentityClaimDTO[] getAllUserIdentityClaims() throws IdentityMgtServiceException { String userName = CarbonContext.getThreadLocalCarbonContext().getUsername(); return UserIdentityManagementUtil.getAllUserIdentityClaims(userName); }
/** * Returns all user claims which can be used in the identity recovery * process * such as the email address, telephone number etc * * @return * @throws IdentityMgtServiceException */ public UserIdentityClaimDTO[] getAllUserIdentityClaims() throws IdentityMgtServiceException { String userName = CarbonContext.getThreadLocalCarbonContext().getUsername(); return UserIdentityManagementUtil.getAllUserIdentityClaims(userName); }
static void checkAccess(String resourceId) throws UserStoreException { if (isSuperTenantResource(resourceId) && !isSuperTenant()) { StringBuilder stringBuilder = new StringBuilder("Unauthorized attempt to modify super tenant resource by tenant domain - "); stringBuilder.append(CarbonContext.getThreadLocalCarbonContext().getTenantDomain()).append(" tenant id - ") .append(CarbonContext.getThreadLocalCarbonContext().getTenantId()).append(" user - ") .append(CarbonContext.getThreadLocalCarbonContext().getUsername()); log.warn(stringBuilder.toString()); throw new UserStoreException("Access Denied"); } }
private void checkCrossTenantAccess(String tenantDomain) throws IdentityRecoveryClientException { String loggedInUser = CarbonContext.getThreadLocalCarbonContext().getUsername(); String loggedInTenant = CarbonContext.getThreadLocalCarbonContext().getTenantDomain(); if (!StringUtils.equals(loggedInTenant, tenantDomain)) { String errorMsg = String.format("Unauthorized Access. User %s@%s trying to retrieve challenge questions " + "of %s tenant", loggedInUser, loggedInTenant, tenantDomain); throw new IdentityRecoveryClientException(errorMsg); } }
public static String getLoggedInUserName() { String userName = ""; if (CarbonContext.getCurrentContext().getTenantId() != 0) { userName = CarbonContext.getCurrentContext().getUsername() + "@" + CarbonContext.getCurrentContext().getTenantDomain(); } else { userName = CarbonContext.getCurrentContext().getUsername(); } return userName.trim(); }
public static String getLoggedInUserName() { String userName = ""; if (CarbonContext.getThreadLocalCarbonContext().getTenantId() != 0) { userName = CarbonContext.getThreadLocalCarbonContext().getUsername() + "@" + CarbonContext.getThreadLocalCarbonContext().getTenantDomain(); } else { userName = CarbonContext.getThreadLocalCarbonContext().getUsername(); } return userName.trim(); }
private String getUser() { String user = CarbonContext.getThreadLocalCarbonContext().getUsername(); if (user != null) { user = user + "@" + CarbonContext.getThreadLocalCarbonContext().getTenantDomain(); } else { user = CarbonConstants.REGISTRY_SYSTEM_USERNAME; } return user; } }
private String getLoggedInUserName() { String userName = ""; if (CarbonContext.getThreadLocalCarbonContext().getTenantId() != 0) { userName = CarbonContext.getThreadLocalCarbonContext().getUsername() + "@" + CarbonContext.getThreadLocalCarbonContext().getTenantDomain(); } else { userName = CarbonContext.getThreadLocalCarbonContext().getUsername(); } return userName; }
/** * Returns an APIConsumer which is corresponding to the current logged in user taken from the carbon context * * @return an APIConsumer which is corresponding to the current logged in user * @throws AppManagementException */ public static APIConsumer getLoggedInUserConsumer() throws AppManagementException { String loggedInUser = CarbonContext.getThreadLocalCarbonContext().getUsername(); return APIManagerFactory.getInstance().getAPIConsumer(loggedInUser); }
private String getUser() { String user = CarbonContext.getThreadLocalCarbonContext().getUsername(); if (user != null) { user = user + "@" + CarbonContext.getThreadLocalCarbonContext().getTenantDomain(); } else { user = CarbonConstants.REGISTRY_SYSTEM_USERNAME; } return user; }
private String getUser() { String user = CarbonContext.getThreadLocalCarbonContext().getUsername(); if (user != null) { user = user + "@" + CarbonContext.getThreadLocalCarbonContext().getTenantDomain(); } else { user = CarbonConstants.REGISTRY_SYSTEM_USERNAME; } return user; }
private String getUser() { String user = CarbonContext.getThreadLocalCarbonContext().getUsername(); if (user != null) { user = user + "@" + CarbonContext.getThreadLocalCarbonContext().getTenantDomain(); } else { user = CarbonConstants.REGISTRY_SYSTEM_USERNAME; } return user; } }
public void addOpenID(String openID) { try { IdentityPersistenceManager persistenceManager = IdentityPersistenceManager.getPersistanceManager(); String userName = CarbonContext.getThreadLocalCarbonContext().getUsername(); persistenceManager.doOpenIdSignUp(IdentityTenantUtil.getRegistry() , AdminServicesUtil.getUserRealm(), openID, userName); } catch (Exception e) { log.error("Error instantiating a Persistence Manager.", e); } }
public void addOpenID(String openID) { try { IdentityPersistenceManager persistenceManager = IdentityPersistenceManager.getPersistanceManager(); String userName = CarbonContext.getThreadLocalCarbonContext().getUsername(); persistenceManager.doOpenIdSignUp(IdentityTenantUtil.getRegistry() , AdminServicesUtil.getUserRealm(), openID, userName); } catch (Exception e) { log.error("Error instantiating a Persistence Manager.", e); } }