我正在使用django-socialregistration應用程序允許用戶通過FB登錄到我的網站。無法登錄Facebook(django-socialregistration)
http://django-socialregistration.readthedocs.org/en/latest/index.html
Twitter並能正常工作,但對Facebook的它一直在以FB返回用戶登錄後此錯誤:
Credentials could not be validated, the provider returned no access token.
它是在應用程序中設置一個錯誤在函數返回(附帶應用程序):
def get_access_token(self, code=None, **params):
"""
Return the memoized access token or go out and fetch one.
"""
if self._access_token is None:
if code is None:
raise ValueError(_('Invalid code.'))
self.access_token_dict = self._get_access_token(code, **params)
try:
self._access_token = self.access_token_dict['access_token']
except KeyError, e:
raise OAuthError("Credentials could not be validated, the provider returned no access token.")
所以我猜沒有訪問令牌可以找到或檢索。
Facebook的調試工具,雖然這時候我輸入的網址回報,
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC- html40/loose.dtd">
<html>
<head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head>
<body><p>Session expired.</p></body>
</html>
這是網址:
www.site.com/social/facebook/callback/?code=AQCb0lWCOTKFYaCQ43imfKvsMgo-8wyA8aq1WxZDWuCel2868I6gou2rn4bN2kTyuL14FxR9cCvrilJB2R5-JOnQqCvo7ihQAi9outrUB81MQdU-XA-5ur7MT5Wlhz3wkb5bc0fwzUYYFpSyeHNjFrIOY6QdZNdrXLcivv1-3qMNOKijLHf0jmZc7bBqPBTkw-Q#_=_
和響應代碼爲FB調試說是200
任何人都知道發生了什麼?
你想讓我在git hub上打開一個問題也許它會更好嗎? – tamara
我無法打印它,因爲我不在其開發本地版本上工作。 – tamara
是的,在Github上打開一個問題可能會更好。 –