RegistrySecurity.java 文件源码

java
阅读 42 收藏 0 点赞 0 评论 0

项目:aliyun-oss-hadoop-fs 作者:
/**
 * Resolve the context of an entry. This is an effective test of
 * JAAS setup, because it will relay detected problems up
 * @param context context name
 * @return the entry
 * @throws RuntimeException if there is no context entry found
 */
public static AppConfigurationEntry[] validateContext(String context)  {
  if (context == null) {
    throw new RuntimeException("Null context argument");
  }
  if (context.isEmpty()) {
    throw new RuntimeException("Empty context argument");
  }
  javax.security.auth.login.Configuration configuration =
      javax.security.auth.login.Configuration.getConfiguration();
  AppConfigurationEntry[] entries =
      configuration.getAppConfigurationEntry(context);
  if (entries == null) {
    throw new RuntimeException(
        String.format("Entry \"%s\" not found; " +
                      "JAAS config = %s",
            context,
            describeProperty(Environment.JAAS_CONF_KEY) ));
  }
  return entries;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号