2012-08-29 105 views
0

我已經在我的play 2應用中成功安裝了securesocial,並且我已經爲google和facebook工作。但我有嘰嘰喳喳的問題在Heroku上使用Twitter和Playframework 2.0 Securesocial

我的conf文件具有以下

# 
# Twitter 
# 
securesocial.twitter.requestTokenURL=https://twitter.com/oauth/request_token 
securesocial.twitter.accessTokenURL=https://twitter.com/oauth/access_token 
securesocial.twitter.authorizationURL=https://twitter.com/oauth/authenticate 
securesocial.twitter.consumerKey=mykey 
securesocial.twitter.consumerSecret=mysecret 

,但我得到了以下異常。

securesocial.provider.AuthenticationException: Authorization failed (server replied with a 401). This can happen if the consumer key was not correct or the signatures did not match. 

我的密鑰和祕密與我爲我爲此應用創建的twitter API帳戶應用的相同。我還包含了從中調用此請求的網站和@anywhere域。

任何想法?

+0

也許是Twitter的@anywhere功能的問題。嘗試使用本地主機註冊Twitter應用程序。 –

+0

我有部署在heroku上的應用程序,所以使用heroku url – rayray

+1

不知道:(也許嘗試使用示例(https://github.com/jaliss/securesocial/tree/master/samples)並查看它是否有效。 –

回答

1

確保您的計算機中的時間設置正確。如果您的計算機中的本地時間與其服務器中的時間相比偏離了某個偏移量,則Twitter將返回該錯誤。希望這可以幫助。