org.jasig.cas.authentication.Authentication.getFailures()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(141)

本文整理了Java中org.jasig.cas.authentication.Authentication.getFailures()方法的一些代码示例,展示了Authentication.getFailures()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Authentication.getFailures()方法的具体详情如下:
包路径:org.jasig.cas.authentication.Authentication
类名称:Authentication
方法名:getFailures

Authentication.getFailures介绍

[英]Gets a map describing failed authentications. By definition the failures here were not sufficient to prevent authentication.
[中]获取描述失败的身份验证的映射。根据定义,此处的故障不足以阻止身份验证。

代码示例

代码示例来源:origin: org.jasig.cas/cas-server-core-authentication

@Override
  public boolean isSatisfiedBy(final Authentication authentication) {
    for (final String handler : authentication.getFailures().keySet()) {
      if (authentication.getFailures().get(handler).isAssignableFrom(PreventedException.class)) {
        return false;
      }
    }
    return super.isSatisfiedBy(authentication);
  }
}

代码示例来源:origin: org.jasig.cas/cas-server-core-authentication

/**
 * Creates a new instance from an authentication event that was successful prior to principal resolution.
 *
 * @param authentication Authentication event.
 */
public UnresolvedPrincipalException(final Authentication authentication) {
  super(UNRESOLVED_PRINCIPAL, authentication.getFailures(), authentication.getSuccesses());
}

代码示例来源:origin: org.jasig.cas/cas-server-core-authentication

/**
   * Creates a new instance from an authentication event that was successful prior to principal resolution.
   * This form should be used when a resolver exception prevented principal resolution.
   *
   * @param authentication Authentication event.
   * @param cause Exception that prevented principal resolution.
   */
  public UnresolvedPrincipalException(final Authentication authentication, final Exception cause) {
    super(cause.getMessage(), authentication.getFailures(), authentication.getSuccesses());
  }
}

代码示例来源:origin: org.jasig.cas/cas-server-core-authentication

/**
 * Creates a new instance from what would otherwise have been a successful authentication event and the two
 * disparate principals resolved.
 *
 * @param authentication Authentication event.
 * @param a First resolved principal.
 * @param b Second resolved principal.
 */
public MixedPrincipalException(final Authentication authentication, final Principal a, final Principal b) {
  super(a + " != " + b, authentication.getFailures(), authentication.getSuccesses());
  this.first = a;
  this.second = b;
}

代码示例来源:origin: org.jasig.cas/cas-server-core-authentication

@Override
  public boolean isSatisfiedBy(final Authentication authn) {
    boolean credsOk = true;
    if (this.tryAll) {
      credsOk = authn.getCredentials().size() == authn.getSuccesses().size()
        + authn.getFailures().size();
    }
    return credsOk && StringUtils.isNotBlank(this.requiredHandlerName)
          && authn.getSuccesses().containsKey(this.requiredHandlerName);
  }
}

代码示例来源:origin: org.jasig.cas/cas-server-core-authentication

@Override
  public boolean isSatisfiedBy(final Authentication authn) {
    if (this.tryAll) {
      return authn.getCredentials().size() == authn.getSuccesses().size() + authn.getFailures().size();
    }
    return !authn.getSuccesses().isEmpty();
  }
}

代码示例来源:origin: org.jasig.cas/cas-server-core-authentication

@Override
public boolean equals(final Object obj) {
  if (!(obj instanceof Authentication)) {
    return false;
  }
  if (obj == this) {
    return true;
  }
  final Authentication other = (Authentication) obj;
  final EqualsBuilder builder = new EqualsBuilder();
  builder.append(this.principal, other.getPrincipal());
  builder.append(this.credentials, other.getCredentials());
  builder.append(this.successes, other.getSuccesses());
  builder.append(this.authenticationDate, other.getAuthenticationDate());
  builder.append(wrap(this.attributes), other.getAttributes());
  builder.append(wrap(this.failures), other.getFailures());
  return builder.isEquals();
}

代码示例来源:origin: org.jasig.cas/cas-server-core-authentication

.addFailures(authn.getFailures())
.addCredentials(authn.getCredentials());

代码示例来源:origin: net.unicon/cas-mfa-java

failures.putAll(authn.getFailures());

代码示例来源:origin: org.jasig.cas/cas-server-core-authentication

/**
 * Creates a new builder initialized with data from the given authentication source.
 *
 * @param source Authentication source.
 *
 * @return New builder instance initialized with all fields in the given authentication source.
 */
public static AuthenticationBuilder newInstance(final Authentication source) {
  final DefaultAuthenticationBuilder builder = new DefaultAuthenticationBuilder(source.getPrincipal());
  builder.setAuthenticationDate(source.getAuthenticationDate());
  builder.setCredentials(source.getCredentials());
  builder.setSuccesses(source.getSuccesses());
  builder.setFailures(source.getFailures());
  builder.setAttributes(source.getAttributes());
  return builder;
}

相关文章