英文:
How to set order of custom ProtocolMapper in keycloak?
问题
我在Keycloak中有许多自定义的ProtocolMapper,它们运行良好。
但是它们的工作顺序对我来说不太清楚。我曾认为工作顺序等于org.keycloak.protocol.ProtocolMapper中字符串的顺序,但这并不正确。
我的注册文件如下:
com.example.sso.mapper.FirstMapper // 第二个运行
com.example.sso.mapper.SecondMapper // 第一个运行
com.example.sso.mapper.ThirdMapper // 第三个运行
我如何控制它们的工作顺序?
英文:
I have many custom ProtocolMapper in keycloak and they work fine.
But order of work is not clear for me. I was thinking that order equals order of string in org.keycloak.protocol.ProtocolMapper but it is not true.
My registration file
com.example.sso.mapper.FirstMapper // work second
com.example.sso.mapper.SecondMapper // work first
com.example.sso.mapper.ThirdMapper // work third
How can i controll order of they work?
答案1
得分: 1
根据我所知,您无法控制映射器的顺序。如果一个映射器依赖于另一个映射器设置的信息,也许您应该考虑将它们合并为一个单一的映射器。setClaim
函数可以一次向令牌添加多个声明。这样,您可以确保所有所需的声明都已设置。
英文:
As far as I am aware, you cannot control the order of mappers. If one mapper depends on information that another mapper sets, maybe you should consider turning them into a single mapper. The setClaim
function can add multiple claims to a token at the same time. That way you can be certain that all your required claims are set.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论