2012-02-16 1 views
1

access_tokens 나는이 전화를 사용할 때확장 기존 오프라인 내가 방법 <a href="https://developers.facebook.com/docs/offline-access-deprecation/" rel="nofollow">https://developers.facebook.com/docs/offline-access-deprecation/</a></p> <p>을 찾았지만 여기</p> <p>내 데이터베이스에 저장된 모든 사용자의 오프라인 액세스 토큰을 확장 할 필요가

https://graph.facebook.com/oauth/access_token?    
    client_id=APP_ID& 
    client_secret=APP_SECRET& 
    grant_type=fb_exchange_token& 
    fb_exchange_token=EXISTING_ACCESS_TOKEN 

일부 사용자의 경우 새 토큰을 얻습니다.

access_token=xxxxxxx&expires=5102358 

다른 사람들에게 왜 나는 아무것도받지 못합니까?

는이 코드

$request_url = "https://graph.facebook.com/oauth/access_token?client_id=xxxx&client_secret=xxxx&grant_type=fb_exchange_token&fb_exchange_token=xxxx"; 

$ 정보 = file_get_contents ($의 요청 URL을)를 사용;

미리 도움을 주셔서 감사합니다.

답변

2

다른 사용자의 액세스 토큰이 변환하려고 시도 할 때 이미 만료되었을 수 있습니다. 만료되지 않은 액세스 토큰 만 확장 할 수 있습니다. 만료되면 재사용하기 위해 사용자가 앱으로 돌아갈 필요가 있습니다.

+0

OAuth의 facebooks 구현에 새로 고침 토큰 부분이 없다는 인상하에있었습니다. 그게 바뀌 었 니? 거기에 대한 공식적인 문서가 있습니까? –

+1

https://developers.facebook.com/docs/offline-access-deprecation/을 찾을 수 없습니다. * 클라이언트 측 OAuth 및 새 끝점을 통해 Access_Token 만료 시간 연장 * 섹션을 참조하십시오. – DMCS

+1

화려한, 고마워. –