Google Buzz API 오류
-
18-09-2020 - |
문제
Google Buzz API를 사용하여 Google Buzz 계정에 일부 콘텐츠를 게시하려고합니다. 나는 그들이 제공 한 샘플 코드를 사용하여 시도했지만, 아래 오류를주는
Array
.
( [http_code]=> 401. [헤더]=> 배열 ( [www-authenticate]=> authsub realm="https://www.google.com/accounts/authsubrequest"허용 - scopes="https://www.googleapis.com/auth/buzz" [Content-Type]=> 응용 프로그램 / JSON; charset= UTF-8. [날짜]=> TUE, 20 JUL 2010 12:22:05 GMT [만료]=> TUE, 20 JUL 2010 12:22:05 GMT [Cache-Control]=> private, max-age= 0 [x-content-type-options]=> nosniff [X-FRAME-OPTIONS]=> SOCKORIGIN [X-XSS 보호]=> 1; 모드= 블록 [서버]=> GSE. [전송 - 인코딩]=> 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.
)
)
.
)
필자는 필요한 config.php 파일에 변수를 추가했습니다
'site_name' => 'example.com',
.
'oauth_consumer_key'=> 'example.com', 'oauth_consumer_secret'=> ''소비자 ', 'oauth_rsa_key'=> '',
아무도 내가 여기서 뭘 잘못 할지를 알고 있나 ??
데이터베이스에 반환되는 토큰을 어떻게 저장할 수 있습니까 ?? 서버가 다시 시작되면 캐시가 손실되고 사용자가 다시 인증해야합니다.
해결책
문제는 제가 통과 한 도메인과 함께했습니다.example.com을 지나가는 대신 "nofollow noreferrer"> http://example.com/a> 전달되었습니다.따라서 site_name, oauth_consumer_key 및 도메인 변수가 올바르게 전달되었는지 확인하십시오.