public boolean authenticate(String userName, String credential) throws UserStoreException { return getUserStoreManager().authenticate(userName, credential); }
/** * Verify user name/password authentication. * * @param username User name * @param password Password * @return true if user successfully authenticated */ public static boolean doLogin(String username, String password) { try { UserStoreManager userStore = IdentityTenantUtil.getRealm(null, username).getUserStoreManager(); return userStore.authenticate(username, password); } catch (Exception e) { log.error("Error while authenticating user", e); return false; } }
/** * Verify user name/password authentication. * * @param username User name * @param password Password * @return true if user successfully authenticated */ public static boolean doLogin(String username, String password) { try { UserStoreManager userStore = IdentityTenantUtil.getRealm(null, username).getUserStoreManager(); return userStore.authenticate(username, password); } catch (Exception e) { log.error("Error while authenticating user", e); return false; } }
private boolean authenticate(String username, String password, RealmService realmService) { PrivilegedCarbonContext carbonContext = PrivilegedCarbonContext.getThreadLocalCarbonContext(); RegistryService registryService = (RegistryService) carbonContext.getOSGiService(RegistryService.class, null); String tenantDomain = MultitenantUtils.getTenantDomain(username); try { UserRealm userRealm = AnonymousSessionUtil.getRealmByTenantDomain(registryService, realmService, tenantDomain); if (userRealm == null) { log.error(String.format("Can't get the user realm for the tenant domain %s. Invalid domain or unactivated tenant login.", tenantDomain)); return false; } String tenantAwareUsername = MultitenantUtils.getTenantAwareUsername(username); return userRealm.getUserStoreManager().authenticate(tenantAwareUsername, password); } catch (CarbonException e) { log.error(String.format("Can't get the user realm for the tenant domain %s.", tenantDomain), e); return false; } catch (UserStoreException e) { log.error("Error while authenticating the user against the user store manager", e); return false; } }
UserStoreManager userStoreManager = (UserStoreManager) BasicAuthRequestPathAuthenticatorServiceComponent. getRealmService().getTenantUserRealm(tenantId).getUserStoreManager(); boolean isAuthenticated = userStoreManager.authenticate( MultitenantUtils.getTenantAwareUsername(username), password); if (!isAuthenticated) {
UserStoreManager userStoreManager = (UserStoreManager) BasicAuthRequestPathAuthenticatorServiceComponent. getRealmService().getTenantUserRealm(tenantId).getUserStoreManager(); boolean isAuthenticated = userStoreManager.authenticate( MultitenantUtils.getTenantAwareUsername(username), password); if (!isAuthenticated) {
if (userRealm != null) { userStoreManager = (UserStoreManager) userRealm.getUserStoreManager(); isAuthenticated = userStoreManager.authenticate(MultitenantUtils.getTenantAwareUsername(username), password); } else { throw new AuthenticationFailedException("Cannot find the user realm for the given tenant: " +
isAuthenticated = realm.getUserStoreManager().authenticate( tenantAwareUserName, password);
isAuthenticated = realm.getUserStoreManager().authenticate( tenantAwareUserName, password);
public static boolean authenticate(String username, String password) throws DataServiceFault { try { RegistryService registryService = DataServicesDSComponent.getRegistryService(); UserRealm realm = registryService.getUserRealm( PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId()); username = MultitenantUtils.getTenantAwareUsername(username); return realm.getUserStoreManager().authenticate(username, password); } catch (Exception e) { throw new DataServiceFault(e, "Error in authenticating user '" + username + "'"); } }
if (userRealm != null) { userStoreManager = (UserStoreManager) userRealm.getUserStoreManager(); isAuthenticated = userStoreManager.authenticate( MultitenantUtils.getTenantAwareUsername(username), password); } else {
isAuthenticated = realm.getUserStoreManager().authenticate( tenantAwareUserName, password);
isAuthenticated = IdentityTenantUtil.getRealm(domainName, userName).getUserStoreManager().authenticate( tenantUser, password);
if ( userRealm != null ) { userStoreManager = (UserStoreManager) userRealm.getUserStoreManager(); boolean isAuthenticated = userStoreManager.authenticate(MultitenantUtils. getTenantAwareUsername(userName), password); if ( isAuthenticated ) {
isAuthenticated = IdentityTenantUtil.getRealm(domainName, userName).getUserStoreManager().authenticate( tenantUser, password);
if ( userRealm != null ) { userStoreManager = (UserStoreManager) userRealm.getUserStoreManager(); boolean isAuthenticated = userStoreManager.authenticate(MultitenantUtils. getTenantAwareUsername(userName), password); if ( isAuthenticated ) {
isAuthenticated = IdentityTenantUtil .getRealm(domainName, params.getAuthorizedbyUserName()).getUserStoreManager() .authenticate(tenantUser, params.getAuthorizedbyUserPassword()); } catch (UserStoreException e) { log.error("Error while authenticating the user", e);
/** * @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; }
isAuthenticated = IdentityTenantUtil .getRealm(domainName, params.getAuthorizedbyUserName()).getUserStoreManager() .authenticate(tenantUser, params.getAuthorizedbyUserPassword()); } catch (UserStoreException e) { log.error("Error while authenticating the user", e);