【发布时间】:2016-04-08 03:44:56
【问题描述】:
我正在尝试实现用于 WSO2-IS 和 WSO2-APIM 的自定义身份验证器。但是,我找不到将角色分配给经过身份验证的用户的方法。
我希望经过身份验证的用户具有“客户”角色。下面是我在方法 processAuthenticationResponse 中使用的代码。
Map<ClaimMapping, String> claims = new HashMap<ClaimMapping, String>();
claims.put(ClaimMapping.build("http://wso2.org/claims/role", "http://wso2.org/claims/role", null, false), "customer");
AuthenticatedUser user = AuthenticatedUser.createLocalAuthenticatedUserFromSubjectIdentifier("xxxxxx");
context.setSubject(user);
非常感谢任何正确实施此操作的指南。
非常感谢。
【问题讨论】: