Não foi possível inicializar o objeto AdaptersAPI no adaptador MobileFirst V8.0 que está levando a NullPointerException

Estou desenvolvendo o adaptador no MFP V8. Abaixo está o meu código para validar nome de usuário e senha:

        import java.util.HashMap;
        import java.util.Map; 
        import java.util.logging.Logger;

        import javax.ws.rs.GET;
        import javax.ws.rs.Path;
        import javax.ws.rs.Produces;
        import javax.ws.rs.core.Context;
        import javax.ws.rs.core.MediaType;

        import com.ibm.mfp.adapter.api.AdaptersAPI;
        import com.ibm.mfp.adapter.api.ConfigurationAPI;
        import com.ibm.mfp.security.checks.base.UserAuthenticationSecurityCheck;
        import com.ibm.mfp.server.registration.external.model.AuthenticatedUser;

        import io.swagger.annotations.Api;
        import io.swagger.annotations.ApiOperation;
        import io.swagger.annotations.ApiResponse;
        import io.swagger.annotations.ApiResponses;

        @Api(value = "Sample Adapter Resource")
        @Path("/resource")
        public class UserValidationSecurityCheck extends UserAuthenticationSecurityCheck{
            private String displayName;
            private String errorMsg;
            private HashMap<String,Object> adapterReponse = null; 
            @Context
            AdaptersAPI adaptersAPI;

            @Override
            protected AuthenticatedUser createUser() {
                return new AuthenticatedUser(displayName, displayName, this.getName(),adapterReponse);
            }

            @Override
            protected boolean validateCredentials(Map<String, Object> credentials) {
                if(credentials!=null && credentials.containsKey("username") && credentials.containsKey("password")){
                    if (credentials.get("username")!=null && credentials.get("password")!=null) {
                        String username = credentials.get("username").toString();
                        String password = credentials.get("password").toString();
                        if (username.equals(password)) {
                            JSONObject loginParams = new JSONObject();

                            loginParams.put("username", username);
                            loginParams.put("password", password);

                            HttpUriRequest httpUriRequest = adaptersAPI.createJavascriptAdapterRequest("LoginAndWeeklyCertAdapter1", "login", loginParams);
                            try {
                                HttpResponse httpResponse = adaptersAPI.executeAdapterRequest(httpUriRequest);
                                adapterReponse = adaptersAPI.getResponseAsJSON(httpResponse);
                                System.out.println(adapterReponse.toString());
                            } catch (IOException e) {
                                // TODO Auto-generated catch block
                                e.printStackTrace();
                            }
                            return true;
                        } else {
                            errorMsg = "Wrong Credentials";
                        }
                    }
                }
                else{
                    errorMsg = "Credentials not set properly";
                }
                return false;
            }

            public boolean isLoggedIn(){
                return getState().equals(STATE_SUCCESS);
            }

            public AuthenticatedUser getRegisteredUser() {
                return registrationContext.getRegisteredUser();
            }

            @Override
            protected Map<String, Object> createChallenge() {
                Map<String, Object> challenge = new HashMap<String, Object>();
                challenge.put("errorMsg", errorMsg);
                challenge.put("remainingAttempts", getRemainingAttempts());
                return challenge;
            }

        @ApiOperation(value = "Returns 'Hello from resource'", notes = "A basic example of a resource returning a constant string.")
        @ApiResponses(value = { @ApiResponse(code = 200, message = "Hello message returned") })
        @GET
        @Produces(MediaType.TEXT_PLAIN)
        public String getResourceData() {
            // log message to server log
            logger.info("Logging info message...");

            return "Hello from resource";
        }

    }

Quando estou enviando a resposta do desafio, recebo NullPointerException na seguinte linha:

HttpUriRequest httpUriRequest = adaptersAPI.createJavascriptAdapterRequest("LoginAndWeeklyCertAdapter1", "login");

PorqueadaptersAPI é nulo. Preciso fazer alguma configuração extra para fazer isso funcionar? Como posso inicializarAdaptersAPI objeto?

Nota: O método de login e a verificação de segurança estão no mesmo adaptador.

Atualizar

Investiguei mais tempo e atualizei o código conforme indicado acima e observei o seguinte:

1 QuandovalidateCredentials() está sendo chamado depois de enviar a resposta do desafio, então eu estou recebendonull valor no objeto AdapterAPI.

2) Onde, quando eu estiver ligando para ogetResourceData() usando a ferramenta swagger mobilefirst, estou recebendo um objeto de AdapterAPI.

questionAnswers(1)

yourAnswerToTheQuestion