为什么不选择本机 Windows 缓存?

发布于 2025-01-10 16:11:09 字数 1183 浏览 3 评论 0原文

查看 https://docs。 oracle.com/javase/8/docs/technotes/guides/security/jgss/tutorials/AcnOnly.html

LoginContext lc = null;
    try {
        lc = new LoginContext("JaasSample", new TextCallbackHandler());
    } catch (LoginException le) {
        System.err.println("Cannot create LoginContext. "
            + le.getMessage());
        System.exit(-1);
    } catch (SecurityException se) {
        System.err.println("Cannot create LoginContext. "
            + se.getMessage());
        System.exit(-1);
    }
    try {

      // attempt authentication
      lc.login();

  } catch (LoginException le) {

      System.err.println("Authentication failed: "
      System.err.println("  " + le.getMessage());
      System.exit(-1);

  }

  System.out.println("Authentication succeeded!");

}

my config file :-

   JaasSample {
    com.sun.security.auth.module.Krb5LoginModule required
    debug=true
    doNotPrompt=true 
    useTicketCache=true
         ;
    };

为什么它不使用已登录的Windows用户的缓存? 难道我理解错了?

提前致谢? 杰姆地毯

looking at https://docs.oracle.com/javase/8/docs/technotes/guides/security/jgss/tutorials/AcnOnly.html

LoginContext lc = null;
    try {
        lc = new LoginContext("JaasSample", new TextCallbackHandler());
    } catch (LoginException le) {
        System.err.println("Cannot create LoginContext. "
            + le.getMessage());
        System.exit(-1);
    } catch (SecurityException se) {
        System.err.println("Cannot create LoginContext. "
            + se.getMessage());
        System.exit(-1);
    }
    try {

      // attempt authentication
      lc.login();

  } catch (LoginException le) {

      System.err.println("Authentication failed: "
      System.err.println("  " + le.getMessage());
      System.exit(-1);

  }

  System.out.println("Authentication succeeded!");

}

my config file :-

   JaasSample {
    com.sun.security.auth.module.Krb5LoginModule required
    debug=true
    doNotPrompt=true 
    useTicketCache=true
         ;
    };

why does it not use the cache of the windows user that has signed on?
Have I misunderstood?

thanks in advance?
JemRug

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文