2015-07-21 60 views
1

我无法使用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/myCustomClaimhttp://wso2.org/claims

检查数据库在{APIM_HOME} /库/数据库/ WSO2CARBON_DB发现了两个H2数据库中的默认WSO2索赔和{APIM_HOME}/repository/database/WSO2AM_DB我无法找到持续存在的“some_value”(即使我只是将{APIM_HOME}目录grep在“some_value”目录中)

有没有需要额外的配置才能完成这项工作?

回答

0

不知道这是什么原因,但我发现下面的有关声明: https://wso2.org/jira/browse/IDENTITY-3016

“这在以前是不可能,因为我们需要知道从user.However登录租户域从5.0这是可能的,因为我们将租户域作为URL的一部分发送“。

可能AM 1.9是否落后于IS 5.0?

+0

我不这么认为:在进行身份验证/ api调用时不会引发异常 – sauce

相关问题