erro de API do Google Buzz
-
18-09-2020 - |
Pergunta
Estou tentando postar algum conteúdo em minha conta do Google Buzz usando a API do Google Buzz.Tentei usar o código de exemplo que eles forneceram, mas deu o erro abaixo
Array
([http_code] => 401 [cabeçalhos] => Array ([www-authenticate] => authsub realM = "https://www.google.com/accounts/authsubrequest" allowed-scopes = "https: // ww. googleapis.com/auth/buzz [content-type] => Application/json;charset=UTF-8 [Data] => Ter, 20 Jul 2010 12:22:05 GMT [Expira] => Ter, 20 Jul 2010 12:22:05 GMT [Cache-Control] => privado, max-age=0 [X-Content-Type-Options] => nosniff [X-Frame-Options] => SAMEORIGIN [X-XSS-Proteção] => 1;modo=bloco [Servidor] => GSE [Transfer-Encoding] => em blocos )
[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.
)
)
)
eu adicionei as variáveis no arquivo config.php que eram necessárias
'site_name' => 'example.com',
'oauth_consumer_key' => 'example.com', 'oauth_consumer_secret' => 'consumidorsegredo', 'oauth_rsa_key' => '',
Alguém sabe o que posso estar fazendo de errado aqui?
Como posso armazenar os tokens que são retornados ao banco de dados?Pois se o servidor for reiniciado o cache é perdido e os usuários precisam se autenticar novamente.
Solução
O problema estava no domínio que eu estava passando.Em vez de passar example.com eu estava passando http://exemplo.com .Portanto, certifique-se de que as variáveis site_name , oauth_consumer_key e domain sejam passadas corretamente.