What are the techniques for Quick Authentication to the XERO API?
===

How can an application check if the user has the correct key? certificate against the api? my current algorithm only checks the accessibility of what is required in-order to make an initial connection to the api but doesn't necessarily check that information is valid.

    /*
    * @TODO validate xero authentication
    */
    function validateXeroAuth(){
        $xero_key = XeroAuths::getSetting('xero_consumer');
        $xero_secret = XeroAuths::getSetting('xero_secret');
        if(file_exists(XERO_PUBLIC_KEY_PATH) && file_exists(XERO_PRIVATE_KEY_PATH)){
            if(validateValue($xero_key) && validateValue($xero_secret)){
                return true; //feature not completely implemented @TODO
            } else return false;
        } else return false;
    }
    //validate the value for xero
    function validateValue($value){
        if(isset($value)){
            if(!is_null($value)){
                if(!empty($value)){
                    return true;
                } else return false;
            } else return false;
        } else return false;
    }

The script in use is opensource and is available at github [here](https://github.com/XeroAPI/PHP-Xero). I've also read the example implementation of the script [here](https://github.com/XeroAPI/XeroOAuth-PHP). But I haven't really found anything :(
