Foros del Web » Programando para Internet » PHP »

oauth + getRequesToken

Estas en el tema de oauth + getRequesToken en el foro de PHP en Foros del Web. Hola, como andan? Estoy queriendome conectar a open x, y para eso debo hacer un login con oauth , ¿Alguien podría decirme por que no ...
  #1 (permalink)  
Antiguo 21/09/2014, 16:15
Avatar de juan_14nob  
Fecha de Ingreso: abril-2010
Mensajes: 552
Antigüedad: 14 años
Puntos: 6
oauth + getRequesToken

Hola, como andan? Estoy queriendome conectar a open x, y para eso debo hacer un login con oauth, ¿Alguien podría decirme por que no puedo obtener el request token?

Código PHP:
Ver original
  1. $oauth = new OAuth($key, $secret, OAUTH_SIG_METHOD_HMACSHA1, OAUTH_AUTH_TYPE_URI );
  2.  
  3. $url = "https://sso.openx.com/api/index/initiate?&oauth_realm=$realm&oauth_timestamp=".time()."&oauth_consumer_key=".$key."&oauth_signature_method=HMAC-SHA1&oauth_callback=http://www.google.com";
  4. $request_token = $oauth->getRequestToken($url, "http://www.google.com");
  5.  
  6. if(!empty($request_token)) {
  7.     print_r($request_token);
  8. } else {
  9.     print "Failed fetching request token, response was: " . $oauth->getLastResponse();
  10. }


Cuando llamo al método getRequestToken me dice este error:

Fatal error: Uncaught exception 'OAuthException' with message 'Invalid auth/bad request (got a 400, expected HTTP/1.1 20X or a redirect)' in /var/www/index.php:46 Stack trace: #0 /var/www/index.php(46): OAuth->getRequestToken('https://sso.ope...', 'http://www.goog...') #1 {main} thrown in /var/www/Taggify/index.php on line 46

saludos
__________________
El castellano es un idioma hermoso, por favor no lo alteres, no lo modifiques, escribe correctamente.

Etiquetas: oauth
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 00:33.