MobileFirst 8.0 - 问题 将安全检查适配器与 javascript HTTP Soap 适配器集成



美好的一天,

我已经修改了两个适配器,一个是安全检查 - 用户登录适配器,另一个是HttpAdapterJs(Javascript适配器),当我在Swagger(肥皂服务)中测试时,HttpAdapterJs工作正常。

当我使用 AdapterAPI 从 UserLogin 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);

然后,我读到这个:无法初始化 MobileFirst V8.0 适配器中的适配器 API 对象,这导致 NullPointerException

  • 安全性检查类不允许适配器 API。

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

我创建了一个新类,我调用了对象来获取数据,但它仍然重新调整空值。

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

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

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

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

最新更新