Welcome Guest, Not a member yet? Register   Sign In
how implement library rest with authentication
#1

Hi,
how i implement authentication with rest (REST_CONTROLLER LIBRARY) and jquery but in global way and not for each petition

jquery
PHP Code:
$config['rest_valid_logins'] = array("admin"=>"1234");$.ajaxSetup({
    xhrFields: {
        withCredentialstrue
    
},
    beforeSend: function (xhr) {
        xhr.setRequestHeader('Authorization''Basic ' btoa('admin:1234'));
    }
}); 

rest
PHP Code:
$config['auth_source'] = 'basic';
$config['rest_valid_logins'] = array("admin"=>"1234"); 


regards
Reply


Messages In This Thread
how implement library rest with authentication - by scasabonne - 03-31-2016, 12:07 PM



Theme © iAndrew 2016 - Forum software by © MyBB