Hello,

I am trying to set up a provider service by following http://drupal.org/comment/reply/1293678/5390332#comment-5390332, but when I go to the endpoint (http://provider.local/oauthlogin/api/user/info?redirect_uri=http%3A%2F%2...), I get an error:

HTTP request sent, awaiting response... 404 Not found: Could not find the controller.
2012-02-08 14:37:34 ERROR 404: Not found: Could not find the controller..

If I switch the server type to XMLRPC it appears to work, but I get a "Parameters must be passed via POST for XMLRPC" error. This led me to believe that the problem might be the same as http://drupal.org/node/650776#comment-4895626, but I got the same Could not find controller error when I changed the endpoint to /oauthlogin/api/user/retrieve in the code.

Any ideas, or is the proper way to set this up even with a REST server? Thanks!

CommentFileSizeAuthor
#3 oauthMe.zip1.36 KBbitmorse
#2 oauthMe.zip1.28 KBbitmorse

Comments

revnoah’s picture

I'm also having this problem. Did you find a solution?

bitmorse’s picture

StatusFileSize
new1.28 KB

Hi guys

I just couldn't find out how to solve this and so the module became completely useless to me. That other resources EXCEPT for "index" were giving me either a 404 or a 401 just added to the problem. I managed to make my own little module which is attached. All it does is it provides a me resource that gives you the info of the logged in user.

Note that this is a workaround and it would still be cool if somebody could fix the oauthloginprovider module... :)

cheers

EDIT:
The oauth CLIENT code I'm using:

 <?php
        $req_url = 'http://SERVER/oauth/request_token';
        $authurl = 'http://SERVERoauth/authorize';
        $acc_url = 'http://SERVER/oauth/access_token';
        $api_url = 'http://SERVER/api/v1';
        $conskey = 'KKKKKKK';
        $conssec = 'SSSSSSSSS';

        session_start();

        // In state=1 the next request should include an oauth_token.
        // If it doesn't go back to 0
        if(!isset($_GET['oauth_token']) && $_SESSION['state']==1) $_SESSION['state'] = 0;
        try {
          $oauth = new OAuth($conskey,$conssec,OAUTH_SIG_METHOD_HMACSHA1,OAUTH_AUTH_TYPE_URI);
          $oauth->enableDebug();
          if(!isset($_GET['oauth_token']) && !$_SESSION['state']) {
            $request_token_info = $oauth->getRequestToken($req_url);
            $_SESSION['secret'] = $request_token_info['oauth_token_secret'];
            $_SESSION['state'] = 1;
            header('Location: '.$authurl.'?oauth_token='.$request_token_info['oauth_token']);
            exit;
          } else if($_SESSION['state']==1) {
            $oauth->setToken($_GET['oauth_token'],$_SESSION['secret']);
            $access_token_info = $oauth->getAccessToken($acc_url);
            $_SESSION['state'] = 2;
            $_SESSION['token'] = $access_token_info['oauth_token'];
            $_SESSION['secret'] = $access_token_info['oauth_token_secret'];
          } 
          $oauth->setToken($_SESSION['token'],$_SESSION['secret']);
          $oauth->fetch("$api_url/me.json");
          $json = json_decode($oauth->getLastResponse());
          print_r($json);
        } catch(OAuthException $E) {
          print_r($E);
        }
bitmorse’s picture

StatusFileSize
new1.36 KB

ATTENTION! The attached module in my above comment still gives the error! Please try this updated one:

zarexogre’s picture

I wanted to use services module to create a simple endpoint and an action to mark private messages as read. Works now, here is what I learnt, basically error messages in services module are not very helpful, had to trawl code to figure out, hope this saves someone some time. http://popthestash.com/2013/10/14/fixed-create-a-custom-service-resource...

matt2000’s picture

Issue summary: View changes
Status: Active » Closed (duplicate)