Pregunta

Estoy tratando de publicar algunos contenidos con mi cuenta de Google Buzz usando la API de Google Buzz. Intenté usar su código de muestra que han proporcionado, pero le da el siguiente error

Array

( [http_code]=> 401 [encabezados]=> matriz ( [Www-autenticate]=> authsub realm="https://www.google.com/accounts/authsutrequest" permitido-scopes="https://www.googleapis.com/auth/buzz" [Tipo de contenido]=> Aplicación / JSON; Charset= UTF-8 [Fecha]=> Tue, 20 jul 2010 12:22:05 GMT [Caduca]=> Tue, 20 jul 2010 12:22:05 GMT [Control de caché]=> Privado, Max-Edad= 0 [Opciones de tipo de contenido X]=> NOSNIFF [X-Frame-Options]=> SameOrigin [X-XSS-Protection]=> 1; MODO= BLOQUE [Servidor]=> gse [Codificación de transferencia]=> Chunked )

[data] => Array
    (
        [error] => Array
            (
                [errors] => Array
                    (
                        [0] => Array
                            (
                                [message] => User must have authorized this application to have the following scope in order to make this call: [https://www.googleapis.com/auth/buzz]  Also , make sure your application is using the Buzz specific OAuth authorization URL.
                                [locationType] => header
                                [location] => Authorization
                            )

                    )

                [code] => 401
                [message] => User must have authorized this application to have the following scope in order to make this call: [https://www.googleapis.com/auth/buzz]  Also , make sure your application is using the Buzz specific OAuth authorization URL.
            )

    )

)

He agregado las variables en el archivo CONFIG.PHP que se requirieron

'site_name' => 'example.com',

'oauth_consumer_key'=> 'example.com', 'oauth_consumer_secret'=> 'Consumersecret', 'oauth_rsa_key'=> '',

¿Alguien sabe lo que podría estar haciendo mal aquí?

¿Cómo puedo almacenar los tokens que se devuelven a la base de datos? Dado que si el servidor se reinicia, el caché se pierde y los usuarios tienen que autenticarse nuevamente.

¿Fue útil?

Solución

El problema fue con el dominio que estaba pasando.En lugar de pasar por ejemplo.com, estaba pasando http://example.com .Así que asegúrese de que el sitio_name, oauth_consumer_key y las variables de dominio se pasan correctamente.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top