When using the default created service, some PHP notices are logged:
Notice: Undefined property: stdClass::$debug in services_endpoint_callback() (line 195 of/var/www/dev.sandbox2.vito.local/sites/all/modules/services/services.module).
Notice: Undefined property: stdClass::$server_settings in services_endpoint_callback() (line 196 of/var/www/dev.sandbox2.vito.local/sites/all/modules/services/services.module).
Notice: Undefined property: stdClass::$debug in services_endpoint_callback() (line 198 of/var/www/dev.sandbox2.vito.local/sites/all/modules/services/services.module).
This can be fixed by providing a slightly completer service endpoint definition in oauthloginprovider.services.inc:
The code below is a full export of the overridden service. I marked the two important things with a comment behind it.
$endpoint = new stdClass();
$endpoint->disabled = FALSE; /* Edit this to true to make a default endpoint disabled initially */
$endpoint->api_version = 3;
$endpoint->name = 'oauthlogin';
$endpoint->server = 'rest_server';
$endpoint->path = 'oauthlogin/api';
$endpoint->authentication = array(
'services_oauth' => array(
'oauth_context' => 'oauthlogin',
),
);
$endpoint->server_settings = array( /* This one */
'rest_server' => array(
'formatters' => array(
'bencode' => TRUE,
'json' => TRUE,
'php' => TRUE,
'rss' => TRUE,
'xml' => TRUE,
'yaml' => TRUE,
'jsonp' => FALSE,
),
'parsers' => array(
'application/json' => TRUE,
'application/vnd.php.serialized' => TRUE,
'application/x-www-form-urlencoded' => TRUE,
'application/x-yaml' => TRUE,
'multipart/form-data' => TRUE,
),
),
);
$endpoint->resources = array(
'oauthlogin' => array(
'alias' => 'user',
'actions' => array(
'info' => array(
'enabled' => 1,
'services_oauth' => array(
'credentials' => 'token',
'authorization' => 'user_info',
),
),
),
),
);
$endpoint->debug = 0; /* This one */
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 1789940.patch | 1023 bytes | matt2000 |
Comments
Comment #1
matt2000 commentedHere's a patch of the above, further refined. The alias 'user' causes bugs in the Services UI (I assume because of the conflict wiht the built-in user resource), so I've renamed it to 'login'.
Bumping priority to critical, since the module doesn't really work as advertised without this fix.
Comment #3
matt2000 commentedFixed in 7.x-1.2-beta