Controller/Adminhtml/Connector/Ajaxvalidation.php
public function execute()
    {
        $params = $this->getRequest()->getParams();
        $apiUsername = $params['api_username'];
        $apiPassword = base64_decode($params['api_password']);
        //validate api, check against account info.
        if ($this->data->isEnabled()) {
            $client = $this->data->getWebsiteApiClient();
            $result = $client->validate($apiUsername, $apiPassword);

            $resonseData['success'] = true;
            //validation failed
            if (!$result) {
                $resonseData['success'] = false;
                $resonseData['message'] = 'Authorization has been denied for this request.';
            }

            $this->getResponse()->representJson($this->jsonHelper->jsonEncode($resonseData));
        }
    }
public function execute()
    {
        $params = $this->getRequest()->getParams();
        $apiUsername = $params['api_username'];
        $apiPassword = base64_decode($params['api_password']);
        //validate api, check against account info.
        if ($this->data->isEnabled()) {
            $client = $this->data->getWebsiteApiClient();
            $result = $client->validate($apiUsername, $apiPassword);

            $resonseData['success'] = true;
            //validation failed
            if (!$result) {
                $resonseData['success'] = false;
                $resonseData['message'] = 'Authorization has been denied for this request.';
            }

            $this->getResponse()->representJson($this->jsonHelper->jsonEncode($resonseData));
        }
    }
public function execute ( ) { $ params = $ this -> getRequest ( ) -> getParams ( ) ; $ apiUsername = $ params [ 'api_username' ] ; $ apiPassword = base64_decode ( $ params [ 'api_password' ] ) ; //validate api, check against account info. if ( $ this -> data -> isEnabled ( ) ) { $ client = $ this -> data -> getWebsiteApiClient ( ) ; $ result = $ client -> validate ( $ apiUsername , $ apiPassword ) ; $ resonseData [ 'success' ] = true ; //validation failed if ( ! $ result ) { $ resonseData [ 'success' ] = false ; $ resonseData [ 'message' ] = 'Authorization has been denied for this request.' ; } $ this -> getResponse ( ) -> representJson ( $ this -> jsonHelper -> jsonEncode ( $ resonseData ) ) ; } }
Validate api user.

@return void
Validate api user .