Keycloak 如何在keydeport';中的httpServletRequest中设置keydeposecuritycontext;s帐户链接文件?

Keycloak 如何在keydeport';中的httpServletRequest中设置keydeposecuritycontext;s帐户链接文件?,keycloak,keycloak-services,Keycloak,Keycloak Services,在Key斗篷的文档中,有一个代码片段: keydeposecuritycontext会话=(keydeposecuritycontext)httpServletRequest.getAttribute(keydeposecuritycontext.class.getName()) 为什么要在httpServletRequest中设置keydeposecuritycontext?这段代码应该在哪里运行?在什么情况下?谢谢。如文档中所述,此代码可以驻留在Java servlet中。包含此servle

在Key斗篷的文档中,有一个代码片段:
keydeposecuritycontext会话=(keydeposecuritycontext)httpServletRequest.getAttribute(keydeposecuritycontext.class.getName())


为什么要在
httpServletRequest
中设置
keydeposecuritycontext
?这段代码应该在哪里运行?在什么情况下?谢谢。

如文档中所述,此代码可以驻留在Java servlet中。包含此servlet的服务器端应用程序必须由keydape OIDC适配器保护,以在请求中获取登录用户的安全上下文。 用户必须已登录才能调用帐户链接。这是文档中列出的先决条件:
应用程序必须已作为现有用户通过OIDC协议登录

邮件列表: