当前位置: 首页>>代码示例>>Java>>正文


Java AuthenticationException类代码示例

本文整理汇总了Java中org.gluu.persist.exception.operation.AuthenticationException的典型用法代码示例。如果您正苦于以下问题:Java AuthenticationException类的具体用法?Java AuthenticationException怎么用?Java AuthenticationException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AuthenticationException类属于org.gluu.persist.exception.operation包,在下文中一共展示了AuthenticationException类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: update

import org.gluu.persist.exception.operation.AuthenticationException; //导入依赖的package包/类
public String update(boolean verifyPassword) throws Exception {
	String result;
	boolean verifyOldPass;
	try {
		verifyOldPass = personService.authenticate(getPerson().getUid(), oldPassword);
	} catch (AuthenticationException e) {
		verifyOldPass = false;
	}
	if ((verifyOldPass || !verifyPassword) /*
											 * && validatePassword().equals(
											 * Configuration.RESULT_SUCCESS)
											 */) {
		getPerson().setUserPassword(newPassword);
		personService.updatePerson(getPerson());
		result = OxTrustConstants.RESULT_SUCCESS;
	} else {
		result = OxTrustConstants.RESULT_FAILURE;
	}
	return result;
}
 
开发者ID:GluuFederation,项目名称:oxTrust,代码行数:21,代码来源:UserPasswordAction.java

示例2: storeNewPassword

import org.gluu.persist.exception.operation.AuthenticationException; //导入依赖的package包/类
public void storeNewPassword(GluuCustomPerson person, boolean validateOldPassword) {
	if (validateOldPassword) {
		boolean resultValidateOldPassword = false;
		try {
			if ((person != null) && StringHelper.isNotEmpty(person.getUid())) {
				resultValidateOldPassword = personService.authenticate(person.getUid(), oldPassword);
			}
		} catch (AuthenticationException ex) {
			log.debug("Failed to verify old person password", ex);
		}

		if (!resultValidateOldPassword) {
			if (graphValidator == null) {
				FacesContext.getCurrentInstance().addMessage(null,
						new FacesMessage(FacesMessage.SEVERITY_ERROR, "Old password isn't valid!", "Old password isn't valid!"));
				
			} else {
				FacesContext.getCurrentInstance().addMessage(graphValidator.getClientId(),
						new FacesMessage(FacesMessage.SEVERITY_ERROR, "Old password isn't valid!", "Old password isn't valid!"));
			}
		}
	}

	FacesContext.getCurrentInstance().addMessage(null,
			new FacesMessage(FacesMessage.SEVERITY_INFO, "Successfully changed!", "Successfully changed!"));
}
 
开发者ID:GluuFederation,项目名称:oxTrust,代码行数:27,代码来源:PasswordValidationAction.java

示例3: authenticate

import org.gluu.persist.exception.operation.AuthenticationException; //导入依赖的package包/类
@Override
public boolean authenticate(String bindDn, String password) {
	try {
		return ldapOperationService.authenticate(bindDn, password);
	} catch (ConnectionException ex) {
		throw new AuthenticationException(String.format("Failed to authenticate DN: %s", bindDn), ex);
	}
}
 
开发者ID:GluuFederation,项目名称:oxCore,代码行数:9,代码来源:LdapEntryManager.java

示例4: processAuthenticationFilter

import org.gluu.persist.exception.operation.AuthenticationException; //导入依赖的package包/类
public String processAuthenticationFilter(AuthenticationFilterWithParameters authenticationFilterWithParameters, Map<?, ?> attributeValues) {
    if (attributeValues == null) {
        return null;
    }
    final Map<String, String> normalizedAttributeValues = normalizeAttributeMap(attributeValues);
    final String resultDn = loadEntryDN(ldapEntryManager, authenticationFilterWithParameters, normalizedAttributeValues);
    if (StringUtils.isBlank(resultDn)) {
        return null;
    }

    if (!Boolean.TRUE.equals(authenticationFilterWithParameters.getAuthenticationFilter().getBind())) {
        return resultDn;
    }

    String bindPasswordAttribute = authenticationFilterWithParameters.getAuthenticationFilter().getBindPasswordAttribute();
    if (StringHelper.isEmpty(bindPasswordAttribute)) {
        log.error("Skipping authentication filter:\n '{}'\n. It should contains not empty bind-password-attribute attribute. ", authenticationFilterWithParameters.getAuthenticationFilter());
        return null;
    }

    bindPasswordAttribute = StringHelper.toLowerCase(bindPasswordAttribute);

    try {
        boolean authenticated = ldapEntryManager.authenticate(resultDn, normalizedAttributeValues.get(bindPasswordAttribute));
        if (authenticated) {
            return resultDn;
        }
    } catch (AuthenticationException ex) {
        log.error("Invalid password", ex);
    }

    return null;
}
 
开发者ID:GluuFederation,项目名称:oxAuth,代码行数:34,代码来源:AuthenticationFilterService.java


注:本文中的org.gluu.persist.exception.operation.AuthenticationException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。