Hi all.
My name is Cesar and I'm working in my final degree projecte. Well, I'm developing an android application and Drupal 7 website, and I have to do the connection between them.
First, I have tried to do user authentication in Android, with REST, and it seems to work, but always in Drupal 7 website, have the same problem :
warning access denied 07/22/2010 - 13:46 api/login Anonymous (not verified)
I think the problem is not the Android app, because the parameters arrive well :
http://domain.com/api/login?User=Cesar&Pass=cesar (user and pass are fake)
I have tried to get those parameters with $_POST var in a module, doing something like this :
<?php
/**
* Implementation of hook_menu
*/
function the_api_login_menu() {
$items = array();
$access = array('View published content');
$items['api/login'] = array(
'title' => t('Log in'),
'page callback' => 'the_api_login_login',
'access arguments' => $access,
'type' => MENU_CALLBACK,
);
return $items;
}
function the_api_login_login() {
$array[0] = $_POST["User"];
$array[1] = $_POST["Pass"];
watchdog("the_api_login", '
'.print_r($_POST, true).'
');
//user_autenticate nos devuelve la id dl user, o falso.
$conection = user_autenticate($array[0],$array[1]);
//if ($conection)drupal_session_inicialize();
}