1

Keycloak/OpenID Connect を使用してユーザーを Windows AD に認証する Web アプリがあります。

ユーザーは、Windows AD ドメインのワークステーションでブラウザーを使用しません。

Web App サーバー (Keycloak アダプターを備えた Tomcat) は、Windows AD ドメインで実行されています。

Web アプリは Keycloak/OpenID Connect 用に構成されています。Keycloakレルムは、Windows AD Kerberos/LDAPを使用するように構成されています。

ユーザーのブラウザーはキークロークのログインに転送し、ログインが成功すると Web アプリに転送します。

Web アプリケーションは、Kerberos チケット/GSS クレデンシャルを使用して IBM i に接続する必要があります。IBM i は、Windows AD を使用して SSO/EIM 用に構成されています。できます。

GSS Credential Forwarding 用に Keycloak クライアントを構成しました。

Keycloak クライアントを使用して、サーブレット リクエストから GSS クレデンシャルを取得しようとしています

            // Obtain accessToken in your application.
        KeycloakPrincipal<KeycloakSecurityContext> kcp = (KeycloakPrincipal<KeycloakSecurityContext>)request.getUserPrincipal();
        AccessToken at = kcp.getKeycloakSecurityContext().getToken();
        String username = at.getPreferredUsername();
        wtr.append("Windows User: ").append(username).append(newLine);

        // Retrieve kerberos credential from accessToken and deserialize it

        Map<String, Object> otherClaims = at.getOtherClaims();
        Object otherClaim = otherClaims.get(KerberosConstants.GSS_DELEGATION_CREDENTIAL);
        String serializedGSSCred = (String) otherClaim;
        GSSCredential gssCredential = KerberosSerializationUtils.deserializeCredential(serializedGSSCred);

「otherClaims」マップは空です。したがって、デシリアライズすると、メッセージとともに null ポインター例外がスローされます

org.keycloak.common.util.KerberosSerializationUtils$KerberosSerializationException: Null credential given as input. Did you enable kerberos credential delegation for your web browser and mapping of gss credential to access token?, Java version: 1.8.0_152, runtime version: 1.8.0_152-b16, vendor: Oracle Corporation, os: 6.2
at org.keycloak.common.util.KerberosSerializationUtils.deserializeCredential(KerberosSerializationUtils.java:70)

私は何が欠けていますか?

4

2 に答える 2