我无法使用WSO2 API管理器1.9.0持久定制声明VIA自定义身份验证器。在上下文中,我一直试图模拟custom twitter authenticator并使用JWT将权利声明传递给我们的后端。配置WSO2 API管理器自定义身份验证器和声明
的认证是这样的:
@Override
protected void processAuthenticationResponse(HttpServletRequest request, HttpServletResponse response, AuthenticationContext context) {
String username = (String) request.getAttribute("userName");
//authenticate
//try to persist claims
context.setSubject(username);
Map<ClaimMapping, String> claims = new HashMap<ClaimMapping, String>();
claims.put(ClaimMapping.build("http://wso2.org/claims/myCustomClaim",
"http://wso2.org/claims/myCustomClaim", null, false), "some_value");
context.setSubjectAttributes(claims);
}
我还添加了http://wso2.org/claims/myCustomClaim
在http://wso2.org/claims
检查数据库在{APIM_HOME} /库/数据库/ WSO2CARBON_DB发现了两个H2数据库中的默认WSO2索赔和{APIM_HOME}/repository/database/WSO2AM_DB我无法找到持续存在的“some_value”(即使我只是将{APIM_HOME}目录grep在“some_value”目录中)
有没有需要额外的配置才能完成这项工作?
我不这么认为:在进行身份验证/ api调用时不会引发异常 – sauce