首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >这个Waffle示例在做什么?

这个Waffle示例在做什么?
EN

Stack Overflow用户
提问于 2013-07-29 07:33:05
回答 1查看 13.3K关注 0票数 6

我试图在Windows上(用Java)实现一个SSO。最近我发现这个例子正在做我想用华夫饼做的事情

代码语言:javascript
复制
// 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-循环之后得到的用户组吗?

谢谢。托马斯。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-07-29 07:56:15

Waffle从Windows获得Kerberos票吗?

华夫乐使用Windows,它代表客户执行所有涉及Kerberos票证的操作。客户从来没看过那张票。

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

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

我可以绝对信任服务器上下文中在do-循环之后得到的用户组吗?

是的,从安全令牌中检索。这是麻省理工学院Kerberos协议的Windows专用扩展。

票数 8
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17918344

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档