6

Windows (Java) で SSO を実装しようとしています。最近、この例が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 ループの後に取得したユーザー グループを完全に信頼できますか?

ありがとう。トーマス。

4

1 に答える 1

8

Waffle は Windows から Kerberos チケットを取得しますか?

Waffle は、クライアントに代わって Kerberos チケットに関連するすべての操作を実行する Windows SSPI を使用します。クライアントはチケットを見ることはありません。

サーバーはクライアントのチケットをどのように検証しますか?

これはケルベロスの基本的な質問です。サーバーに送信されるトークンは、サーバーの秘密鍵によって暗号化されます。これにより、クライアントを認証したチケット保証サービスによってトークンが作成されたことが保証されます。

サーバー コンテキストからの do ループの後に取得したユーザー グループを完全に信頼できますか?

はい、セキュリティ トークンから取得されます。これは、MIT Kerberos プロトコルの Windows 固有の拡張です。

于 2013-07-29T07:56:15.970 に答える