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

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

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

Authentication.getCredentials介绍

[英]Gets a list of metadata about the credentials supplied at authentication time.
[中]获取有关身份验证时提供的凭据的元数据列表。

代码示例

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

@Override
  public boolean isSatisfiedBy(final Authentication authn) {
    return authn.getSuccesses().size() == authn.getCredentials().size();
  }
}

代码示例来源: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

.addCredentials(authn.getCredentials());

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

principalAttributes.putAll(authenticatedPrincipal.getAttributes());
credentials.addAll(authn.getCredentials());
successes.putAll(authn.getSuccesses());
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;
}

相关文章