我正在开发一个UserOperationEventListener
,以便在本地用户存储中使用JIT创建联合用户后执行某些操作。
在doPostAddUser方法中,我必须读取身份验证上下文属性FrameworkConstants
。
UNFILTERED_IDP_CLAIM_VALUES
由于某些声明被DefaultClaimHandler过滤掉,并且在Map <String>,<String>声明变量中不可用。
我知道我可以为IdP添加声明映射,但我更喜欢通过代码操纵这些声明:如何在doPostAddUser
中访问当前的AuthenticationContext?
提前致谢。
无法访问UserOperationEventListener中的AuthenticationContext,根据WSO2 Identity Server设计体系结构,我们不应该这样做。如果您想通过代码修改声明处理逻辑,实现它的最佳方法是按照[1]编写自定义声明处理程序。
[1] https://docs.wso2.com/display/IS570/Writing+a+Custom+Claim+Handler
另一种可能的解决方案是,由于您使用的是Identity Server 5.7.0,因此您可以在JIT期间利用自适应身份验证功能进行声明转换。
看看[1]
user.localClaims[“<local_claim_url>”]
user.remoteClaims[“<remote_claim_url”]
你也可以从[2]了解javascript配置。如果您更喜欢从java编写声明转换逻辑,请使用第一个选项,否则此解决方案也可以根据您的要求自行决定。
[2] https://docs.wso2.com/display/IS570/Configuring+User-Age-Based+Adaptive+Authentication