2017-09-25 6 views
0

は、コードスニペットがあります: KeycloakSecurityContext session = (KeycloakSecurityContext) httpServletRequest.getAttribute(KeycloakSecurityContext.class.getName())Keycloakのアカウントリンク文書のhttpServletRequestでKeycloakSecurityContextを設定するにはどうすればよいですか? Keycloakの<a href="http://www.keycloak.org/docs/3.2/server_development/topics/identity-brokering/account-linking.html" rel="nofollow noreferrer">account-linking</a>ドキュメントで

KeycloakSecurityContexthttpServletRequestに設定されますなぜ?このコードはどこで実行されるべきですか?どんな状況で?ありがとう。

+0

メーリングリスト:http://lists.jboss.org/pipermail/keycloak-user/2017-October/011941.html –

答えて

1

この文書で説明したように、このコードはJavaサーブレットに置くことができます。このサーブレットを含むサーバー側のアプリケーションは、ログインしているユーザーのセキュリティコンテキストを取得するために、Keycloak OIDCアダプターによって保護されている必要があります。 アカウントリンクを呼び出すには、既にログインしている必要があります。これは、ドキュメントに記載されている前提条件です。 The application must already be logged in as an existing user via the OIDC protocol

関連する問題

 関連する問題