AnsweredAssumed Answered

Unable to log in using Oauth for web services

Question asked by yuvraj yuvraj on Apr 10, 2014
Latest reply on Nov 17, 2016 by Divya Priya Rajendran
I am trying to Login with Oauth php . I have installed Oauth on my server,SAML etc. 
My Code :

$url = 'https://crm.domain.net/service/v4_1/rest.php?method=oauth_request_token';



try {
        $oauth = new OAuth('key1', 'key2', OAUTH_SIG_METHOD_HMACSHA1, OAUTH_AUTH_TYPE_URI);//, OAUTH_SIG_METHOD_HMACSHA1, OAUTH_AUTH_TYPE_URI
        $oauth->disableSSLChecks();
        //$oauth->enableDebug();
        $request_token_info = $oauth->getRequestToken($url);
    if(!empty($request_token_info)) {
        print_r($request_token_info);
    } else {
        print "Failed fetching request token, response was: " . $oauth->getLastResponse();
    }
} catch(OAuthException $E) {
    echo "Response: ". $E->lastResponse . "\n";
    var_dump($E);
}

Response Using Url http://dev.domain.net/oauth/oauth.php

object(OAuthException)#2 (9) {
  ["message":protected]=>
   string(73) "Invalid auth/bad request (got a 500, expected HTTP/1.1 20X or a redirect)"
   ["string":"Exception":private]=>
   string(0) ""
   ["code":protected]=>
   int(500)
   ["file":protected]=>
   string(33) "/var/www/html/dev/oauth/oauth.php"
   ["line":protected]=>
   int(43)
   ["trace":"Exception":private]=>
   array(1) {
     [0]=>
     array(6) {
       ["file"]=>
       string(33) "/var/www/html/dev/oauth/oauth.php"
       ["line"]=>
       int(43)
       ["function"]=>
       string(15) "getRequestToken"
       ["class"]=>
       string(5) "OAuth"
       ["type"]=>
       string(2) "->"
       ["args"]=>
       array(1) {
         [0]=>
         string(71) "https://crm.domain.net/service/v4_1/rest.php?method=oauth_request_token"
       }
     }
   }
   ["previous":"Exception":private]=>
   NULL
   ["lastResponse"]=>
   NULL
   ["debugInfo"]=>
   NULL
}
I have created Self Signed  Certificates .(OpenSSL)
I am not getting the exact problem .

Outcomes