wso2 - 在 wso2is 5.10.0 中添加/更新/删除用户角色后发送通知
问题描述
我使用的是 WSO2IS 5.10.0,所以我需要在添加、更新或删除任何用户的用户角色后发送通知电子邮件。为此,我参考了这个 wso2 文档1和2,但它没有按预期工作。有什么办法可以解决这个问题吗?
解决方案
例如,要为添加、更新或删除用户角色后配置电子邮件通知,identity-event.properties 文件中的示例配置如下所示:
module.name.2=emailSend
emailSend.subscription.1=TRIGGER_NOTIFICATION
emailSend.subscription.2=POST_ADD_ROLE
emailSend.subscription.3=POST_UPDATE_ROLE
emailSend.subscription.4=POST_DELETE_ROLE
但是由于 IS5.9.0 引入了新的配置模型,直接将此配置添加到identity-event.properties 中会被覆盖。
因此,您必须将以下配置直接添加到 deployment.toml文件中。
[identity_mgt.events.schemes.emailSend]
subscriptions = [
"TRIGGER_NOTIFICATION",
"POST_ADD_ROLE",
"POST_UPDATE_ROLE",
"POST_DELETE_ROLE"
]
[identity_mgt.events.schemes.emailSend.properties]
'subscription.POST_ADD_ROLE.template' = "testDelete"
您可以在此处为属性下的每个订阅添加属性。
您可以参考此 identity-event.properties.j2 文件以供进一步参考。https://github.com/wso2/carbon-identity-framework/blob/master/features/identity-event/org.wso2.carbon.identity.event.server.feature/resources/identity-event.properties.j2
您可以参考此博客以获取更多信息。
推荐阅读
- dictionary - 如何访问模板字符串中的地图?
- javascript - 具有嵌套关系的 TypeORM findOne
- encryption - bcrypt 如何“知道”给定的哈希是否与给定的密码相关联?
- java - 关闭弹出窗口后在 Selenium 中使用页面上的元素
- kubernetes - 从外部访问 Kubernetes 集群/节点
- sql - 如果列包含某个值,则选择一个预定义的字符串
- kubernetes - 调用服务中所有 pod 的 Kubernetes cronjob
- list - 如何将从未来方法获取的列表转换为 Map
- c++ - 寻找前K个频繁元素
- flutter - 使用TextField时颤动中的过渡动画问题