Domanda

Sto cercando di pubblicare alcuni contenuti sul mio account Google Buzz utilizzando Google Buzz API. Ho provato a utilizzare il loro codice di esempio che hanno fornito, ma dà il seguente errore

Array
.

( [http_code]=> 401 [intestazioni]=> array ( [Www-autenticate]=> Authsub Realm="https://www.google.com/accounts/authsuubrequest" consentito-scopes="https://www.googleappis.com/auth/buzz" [Content-Type]=> Applicazione / JSON; charset= utf-8 [Data]=> Tue, 20 lug 2010 12:22:05 GMT [Scadenza]=> Tue, 20 lug 2010 12:22:05 GMT [Cache-Control]=> Private, Max-Age= 0 [X-Content-Type-Options]=> Nosniff [X-frame-options]=> Sameorigin [X-XSS-Protection]=> 1; Modalità= Blocco [Server]=> GSE [Trasferisci-codifica]=> Bumerizzato )

[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.
            )

    )
.

)

Ho aggiunto le variabili nel file CONFIG.php, che sono stati richiesti

'site_name' => 'example.com',
.

'oauth_consumer_key'=> 'example.com', 'oauth_consumer_secret'=> 'Consumarsecret', 'OAUTH_RSA_KEY'=> '',

Qualcuno sa cosa potrei sbagliare qui ??

Come posso memorizzare i token che vengono restituiti al database ?? Poiché se il server viene riavviato, la cache viene persa e gli utenti devono essere autenticati.

È stato utile?

Soluzione

Il problema era con il dominio che stavo passando.Invece di passare example.com stavo passando http://example.com .Quindi assicurati che il sito_name, l'oauth_consumer_key e le variabili di dominio vengano passati correttamente.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top