private boolean isUserExistsInDomain(UserStoreManager userStoreManager, String userName) throws UserStoreException { boolean isExists = false; if (userStoreManager.isExistingUser(userName)) { isExists = true; } return isExists; }
private boolean isUserExistsInDomain(UserStoreManager userStoreManager, String userName) throws UserStoreException { boolean isExists = false; if (userStoreManager.isExistingUser(userName)) { isExists = true; } return isExists; }
private boolean isUserExistsInDomain(UserStoreManager userStoreManager, String userName) throws AccountLockException { boolean isExists = false; try { if (userStoreManager.isExistingUser(userName)) { isExists = true; } } catch (UserStoreException e) { throw new AccountLockException("Error occurred while check user existence: " + userName, e); } return isExists; }
public boolean isExistingUser(String userName) throws UserStoreException { return getUserStoreManager().isExistingUser(userName); }
userStoreManager = (UserStoreManager) CarbonContext.getThreadLocalCarbonContext().getUserRealm() .getUserStoreManager(); isAuthenticated = userStoreManager.isExistingUser(MultitenantUtils.getTenantAwareUsername(username)); } catch (org.wso2.carbon.user.api.UserStoreException e) { throw new AuthenticationFailedException("IWAAuthenticator failed while trying to find user existence", e);
userStoreManager = (UserStoreManager) CarbonContext.getThreadLocalCarbonContext().getUserRealm() .getUserStoreManager(); isAuthenticated = userStoreManager.isExistingUser(MultitenantUtils.getTenantAwareUsername(username)); } catch (org.wso2.carbon.user.api.UserStoreException e) { throw new AuthenticationFailedException("IWAAuthenticator failed while trying to find user existence", e);
boolean isUserExistInCurrentDomain = userStoreManager.isExistingUser(usernameWithDomain); if (!isUserExistInCurrentDomain) { if (log.isDebugEnabled()) {
public boolean hasAssociation(String openId) { try { if (registry.resourceExists(IdentityRegistryResources.OPENID_SIGN_UP + getOpenIdModified(openId))) { OpenIDUserDO openIDUserDo = resourceToObject(registry .get(IdentityRegistryResources.OPENID_SIGN_UP + getOpenIdModified(openId))); // Checks whether the user is existing. if (realm.getUserStoreManager().isExistingUser(openIDUserDo.getUserName())) { return true; } else { registry.delete(IdentityRegistryResources.OPENID_SIGN_UP + getOpenIdModified(openId)); return false; } } else { if (log.isDebugEnabled()) { log.debug("Unable to find an Sign-Up for " + openId); } } } catch (RegistryException e) { log.error("Error retrieving the resource", e); } catch (Exception e) { log.error("Error retrieving the user information from user store", e); } return false; }
public boolean hasAssociation(String openId) { try { if (registry.resourceExists(IdentityRegistryResources.OPENID_SIGN_UP + getOpenIdModified(openId))) { OpenIDUserDO openIDUserDo = resourceToObject(registry .get(IdentityRegistryResources.OPENID_SIGN_UP + getOpenIdModified(openId))); // Checks whether the user is existing. if (realm.getUserStoreManager().isExistingUser(openIDUserDo.getUserName())) { return true; } else { registry.delete(IdentityRegistryResources.OPENID_SIGN_UP + getOpenIdModified(openId)); return false; } } else { if (log.isDebugEnabled()) { log.debug("Unable to find an Sign-Up for " + openId); } } } catch (RegistryException e) { log.error("Error retrieving the resource", e); } catch (Exception e) { log.error("Error retrieving the user information from user store", e); } return false; }
userStoreManager = realm.getUserStoreManager(); if(!userStoreManager.isExistingUser(username))
public boolean hasAssociation(String openId) { try { if (registry.resourceExists(IdentityRegistryResources.OPENID_SIGN_UP + getOpenIdModified(openId))) { OpenIDUserDO openIDUserDo = resourceToObject(registry .get(IdentityRegistryResources.OPENID_SIGN_UP + getOpenIdModified(openId))); // Checks whether the user is existing. if (realm.getUserStoreManager().isExistingUser(openIDUserDo.getUserName())) { return true; } else { registry.delete(IdentityRegistryResources.OPENID_SIGN_UP + getOpenIdModified(openId)); return false; } } else { if (log.isDebugEnabled()) { log.debug("Unable to find an Sign-Up for " + openId); } } } catch (RegistryException e) { log.error("Error retrieving the resource", e); } catch (Exception e) { log.error("Error retrieving the user information from user store", e); } return false; }
public static Registry getUserRegistry(String mashupAuthor, int tenantId) throws CarbonException { if (registryService == null) { throw new CarbonException("Registry is null"); } try { if(registryService.getUserRealm(tenantId).getUserStoreManager().isExistingUser(mashupAuthor)) { return registryService.getGovernanceUserRegistry(mashupAuthor, tenantId); } else { throw new CarbonException("Unable to access Registry, mashup author is not an active user"); } } catch (UserStoreException e) { log.error(e.getMessage(), e); throw new CarbonException(e); }catch (RegistryException e) { log.error(e.getMessage(), e); throw new CarbonException(e); } } }
if (!userStore.isExistingUser(userName)) { userStore.addUser(userName, null, null, null, null, true); success = true;
/** * Returns whether a given username is already taken by a user or not. * * @param username Username. * @return True if the username is already taken, else false. */ public boolean isUsernameAlreadyTaken(String username) throws IdentityRecoveryException { boolean isUsernameAlreadyTaken = true; String tenantDomain = MultitenantUtils.getTenantDomain(username); try { String tenantAwareUsername = MultitenantUtils.getTenantAwareUsername(username); UserRealm userRealm = getUserRealm(tenantDomain); if (userRealm != null) { isUsernameAlreadyTaken = userRealm.getUserStoreManager().isExistingUser(tenantAwareUsername); } } catch (CarbonException | org.wso2.carbon.user.core.UserStoreException e) { throw new IdentityRecoveryException("Error while retrieving user realm for tenant : " + tenantDomain, e); } return isUsernameAlreadyTaken; }
if (!userRealm.getUserStoreManager().isExistingUser(reviewer)) { throw new RegistryException("No such user '" + reviewer + "'");
getSecondaryUserStoreManager(user.getUserStoreDomain()); if (userStoreManager.isExistingUser(user.getUserName())) { return !(isUserDisabled(userStoreManager, user) || isUserLocked(userStoreManager, user));
getSecondaryUserStoreManager(user.getUserStoreDomain()); if (userStoreManager.isExistingUser(user.getUserName())) { return !(isUserDisabled(userStoreManager, user) || isUserLocked(userStoreManager, user));
if (!userRealm.getUserStoreManager().isExistingUser(username)) { if (!GOOGLE_APPS_IDP_NAME.equals(userRealm.getRealmConfiguration().getUserStoreProperties() .get(UserCoreConstants.RealmConfig.PROPERTY_EXTERNAL_IDP))) {
/** * @param dto * @return * @throws IdentityException * @throws RegistryException */ public boolean addOpenIdToProfile(OpenIDDTO dto) throws IdentityException, RegistryException { String openID = dto.getOpenID(); String tenantDomain = MultitenantUtils.getDomainNameFromOpenId(openID); UserRealm realm = IdentityTenantUtil.getRealm(tenantDomain, dto.getUserName()); try { if (realm.getUserStoreManager().isExistingUser(dto.getUserName())) { if (dto.getPassword() != null) { boolean authenticated = realm.getUserStoreManager().authenticate( dto.getUserName(), dto.getPassword()); if (authenticated) { return doOpenIDSignUp(dto.getUserName(), dto.getOpenID()); } } else { return doOpenIDSignUp(dto.getUserName(), dto.getOpenID()); } } } catch (Exception e) { throw new IdentityException(e.getMessage(), e); } return false; }
if (user != null && userRealm.getUserStoreManager().isExistingUser(tenantAwareUserName)) { dto.setAuthenticated(true); dto.setUserID(user); if (persistentManager.hasSignedUpForOpenId(registry, userRealm, openID.getOpenID())) { user = persistentManager.getUserIdForOpenIDSignUp(registry, userRealm, openID.getOpenID()); if (userRealm.getUserStoreManager().isExistingUser(user)) { domainName = MultitenantUtils.getTenantDomain(user); CarbonAuthenticationUtil