这是我用于Twitter登录的代码,我试图在AIR Mobile中使用它

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 search:String =“ oauth_verifier =”;

但是twitter返回的url中缺少oauth_verifier参数。
并要求我在webView中打印错误消息是SSL。

请在这里指导我我在做什么错

最佳答案

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 = true');

关于authentication - AIR移动Twitter OAuth不返回oauth_verifier,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/23085140/

10-15 19:21