2014-04-15 29 views
0

這是我的Twitter登錄代碼,我想在AIR移動AIR的Twitter移動OAuth的不返回oauth_verifier

requestToken = OAuthUtil.getTokenFromResponse(e.currentTarget.data)使用這個; var authRequest:URLRequest = new URLRequest('http://api.twitter.com/oauth/authorize?oauth_token='+ requestToken.key +'& force_login = true');

   // StageWebView to Authorize the App 
       twitterWebView = new StageWebView(); 
       twitterWebView.viewPort = new Rectangle(FlexGlobals.topLevelApplication.width/2 - FlexGlobals.topLevelApplication.width *.45,FlexGlobals.topLevelApplication.height -FlexGlobals.topLevelApplication.height * .94 ,(FlexGlobals.topLevelApplication.width* .90),FlexGlobals.topLevelApplication.height * .85); 
       twitterWebView.stage = this.stage; 
       twitterWebView.assignFocus(); 
       twitterWebView.loadURL(authRequest.url); 
       twitterWebView.addEventListener(LocationChangeEvent.LOCATION_CHANGE, onLocationChange); 
       twitterWebView.addEventListener(Event.COMPLETE, onLocationEventCompete); 
       twitterWebView.addEventListener(ErrorEvent.ERROR,handleError); 

現在的問題是在onLocationEventCompete我試圖讓 VAR搜索:字符串= 「oauth_verifier =」;

但是twitter返回的url中缺少oauth_verifier參數。 並給我打印在webView中的錯誤信息是SSL是必需的。

請指導我什麼,我做錯了

+0

任何人都面臨同樣的問題? – user2042077

回答

0

authRequest:=的URLRequest新的URLRequest( 'http://api.twitter.com/oauth/authorize?oauth_token= '+ requestToken.key +' & force_login = TRUE');

更改協議爲https 例如: authRequest:的URLRequest =新的URLRequest( 'HTTPS://api.twitter.com/oauth/authorize組oauth_token =' + requestToken.key + '& force_login =真' );

+0

感謝Ashwin, 它爲我工作。非常感謝 – user2042077