I'm make a PUT request to a Drupal API end point created via a custom module and have enabled HTTP based authentication. When I call the api via rest client using Authorization header, the username and password prompts keeps coming again and again even though I supply a valid Drupal user. I see unauthorized user error as well using the advanced rest client on chrome. How do I solve it?
This is the code I am using.
function anonymize_user_services_resources() {
return array(
'update' => array(
'update' => array(
'help' => 'When user is deleted users info should be anonymized',
'callback' => 'anonymize_user_info',
// 'access callback' => 'anonymize_callback',
'access arguments' => array('update anonymize_user'),
'access arguments append' => FALSE,
'args' => array(
array(
'name' => 'id',
'type' => 'int',
'description' => 'The id of the user to update',
'source' => array('path' => '0'),
'optional' => FALSE,
),
),
),
),
);
/**
* Implements hook_permission()
*/
function anonymize_user_permission() {
return array(
'update anonymize_user' => array(
'title' => t('Update inactive user and anonymize'),
'description' => t('Perform rest call to update and anonymize inactive user'),
),
);
}