【问题标题】:MobileFirst 8.0 - Issue integrate Security Check Adapter with javascript HTTP Soap AdapterMobileFirst 8.0 - 问题将安全检查适配器与 javascript HTTP Soap 适配器集成
【发布时间】:2017-04-07 16:24:37
【问题描述】:

美好的一天,

我修改了两个适配器,一个是带有安全检查的 - UserLogin 适配器,另一个是 HttpAdapterJs(Javascript 适配器),当我在 Swagger(soap 服务)中测试时,HttpAdapterJs 工作正常。

当我使用 AdapterAPI 从 UserLogin Adapter 调用 Adapter HttpAdapterJs 时,它将返回空值。

HttpUriRequest req = adaptersAPI.createJavascriptAdapterRequest("HTTPAdapterJS", "getAuthenticationService", URLEncoder.encode(user_name, "UTF-8"), URLEncoder.encode(pass_word); org.apache.http.HttpResponse response = adaptersAPI.executeAdapterRequest(req);

然后,我读到了这个:Unable to initialize AdaptersAPI Object in MobileFirst V8.0 adapter which is leading to NullPointerException

  • 安全检查类不允许 AdapterAPI。

我的下一个解决方案也不起作用:

我创建了新类并调用了对象来获取数据,但它仍然返回空值。

ServiceEmpImp testService = new ServiceEmpImp(); JSONObject objectJson= testService.validateAuthenticationfromService(dataAuth);

还有其他可以正常工作的解决方案吗?

【问题讨论】:

    标签: ibm-mobilefirst mobilefirst-adapters mobilefirst-server


    【解决方案1】:

    虽然安全检查是在适配器中实现的,但 MobileFirst 安全框架和适配器 API 是分开的,不能混用。因此,您不能在安全检查代码中使用适配器 API,例如 AdpatersAPI 接口,也不能在适配器资源代码中使用安全检查 API。

    请参考https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/authentication-and-security/creating-a-security-check/ 有关实施安全检查和开发适配器的详细信息。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-28
      • 1970-01-01
      • 1970-01-01
      • 2013-02-12
      • 1970-01-01
      相关资源
      最近更新 更多