【问题标题】:What is this Waffle SSO example doing这个 Waffle SSO 示例在做什么
【发布时间】:2013-07-29 07:33:05
【问题描述】:

我正在尝试在 Windows(Java 中)上实现 SSO。最近我发现this example 完全可以用Waffle 做我想做的事情:

// client credentials handle
IWindowsCredentialsHandle credentials= WindowsCredentialsHandleImpl.getCurrent("Negotiate");
credentials.initialize();

// initial client security context
WindowsSecurityContextImpl clientContext = new WindowsSecurityContextImpl();
clientContext.setPrincipalName(Advapi32Util.getUserName());
clientContext.setCredentialsHandle(credentials.getHandle());
clientContext.setSecurityPackage(securityPackage);
clientContext.initialize();

// accept on the server
WindowsAuthProviderImpl provider = new WindowsAuthProviderImpl();
IWindowsSecurityContext serverContext = null;

do {  

    if (serverContext != null) {

        // initialize on the client
        SecBufferDesc continueToken = new SecBufferDesc(Sspi.SECBUFFER_TOKEN, serverContext.getToken());
        clientContext.initialize(clientContext.getHandle(), continueToken);
    }  

    // accept the token on the server
    serverContext = provider.acceptSecurityToken(clientContext.getToken(), "Negotiate");

} while (clientContext.getContinue() || serverContext.getContinue());

System.out.println(serverContext.getIdentity().getFqn());
for (IWindowsAccount group : serverContext.getIdentity().getGroups()) {
    System.out.println(" " + group.getFqn());
}            

...

这个例子很简单,它很有效,而且可以完全按照我的意愿去做。但我不明白它是如何工作的。

  • 后台发生了什么?
  • Waffle 是否从 Windows 获得 Kerberos 票证?
  • 服务器如何验证客户端的票据?
  • 我可以绝对信任在 do-loop 之后获得的用户组吗 从服务器上下文?

谢谢。托马斯。

【问题讨论】:

  • 如果我设置此代码,我添加对 jar 的引用,我能够编译我的 jar,但是在运行时,tomcat 抛出 Advautil32 无法解析,我需要将华夫饼罐放在哪里?谢谢

标签: java single-sign-on kerberos waffle


【解决方案1】:

Waffle 是否从 Windows 获得 Kerberos 票证?

Waffle 使用 Windows SSPI,它代表客户端执行所有涉及 Kerberos 票证的操作。客户永远看不到票。

服务器如何验证客户端的票据?

这是一个基本的 Kerberos 问题。发送到服务器的令牌由服务器的密钥加密,这保证了令牌是由对客户端进行身份验证的票证授予服务创建的。

我可以绝对信任从服务器上下文执行循环后获得的用户组吗?

是的,从安全令牌中检索。这是 MIT Kerberos 协议的特定于 Windows 的扩展。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-09-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多