【问题标题】:configuring WSO2 API manager custom authenticator and claims配置 WSO2 API 管理器自定义身份验证器和声明
【发布时间】:2015-07-21 15:38:17
【问题描述】:

我无法通过使用 WSO2 API 管理器 1.9.0 的自定义身份验证器来保留自定义声明。对于上下文,我一直在尝试模拟 custom twitter authenticator 并使用 JWT 将声明传递给我们的后端。

身份验证器如下所示:

@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 中找到的默认 wso2 声明中添加了 http://wso2.org/claims/myCustomClaim

检查在 {APIM_HOME}/repository/database/WSO2CARBON_DB 和 {APIM_HOME}/repository/database/WSO2AM_DB 找到的两个 h2 数据库我无法找到“some_value”得到持久化(即使我只是 grep {APIM_HOME “some_value”的 } 目录。

是否需要一些额外的配置才能完成这项工作?

【问题讨论】:

    标签: java wso2 wso2is wso2-am


    【解决方案1】:

    不确定是不是这个原因,但我发现以下关于索赔的信息: https://wso2.org/jira/browse/IDENTITY-3016

    “这在以前是不可能的,因为我们需要从登录用户那里知道租户域。但是从 IS 5.0 开始,这是可能的,因为我们将租户域作为 URL 的一部分发送”。

    可能 AM 1.9 落后于 IS 5.0?

    【讨论】:

    • 我不认为是这样:进行身份验证/api调用时不会引发异常
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-02-27
    • 1970-01-01
    • 2015-10-27
    • 1970-01-01
    • 2018-10-25
    相关资源
    最近更新 更多