1

Good Day,

I have modified two adapters, one is with Security Check - UserLogin Adapter, and another one is HttpAdapterJs (Javascript adapter) , HttpAdapterJs are work fine when i tested in Swagger (soap service).

when I called the Adapter HttpAdapterJs from UserLogin Adapter using AdapterAPI its will return null values.

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

Then, I read this : Unable to initialize AdaptersAPI Object in MobileFirst V8.0 adapter which is leading to NullPointerException

  • the Security check class does not allowed AdapterAPI.

My Next Solutions also does not work :

I have created new class and I called the object to get data, still it retun null values.

ServiceEmpImp testService = new ServiceEmpImp();

JSONObject objectJson= testService.validateAuthenticationfromService(dataAuth);

Any others solutions that work fine?

Community
  • 1
  • 1
fndong
  • 81
  • 2
  • 11

1 Answers1

1

While security checks are implemented within adapters, the MobileFirst security-framework and adapter APIs are separate and cannot be mixed. Therefore, you cannot use an adapter API, such as the AdpatersAPI interface, in your security-check code, and you cannot use security-check APIs in adapter resource code.

Please refer https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/authentication-and-security/creating-a-security-check/ for details on implementing security check and developing adapters.

Smitha TV
  • 51
  • 3