0
votes

This is my code for twitter login, I am trying to use this in 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);

Now the problem is in onLocationEventCompete I tried to get var search:String = "oauth_verifier=";

but oauth_verifier parameter is missing in url returned by twitter. and giving me error message printed in webView is SSL is required.

Please guide me what I am doing wrong here

1
Anyone have faced the same issue?user2042077

1 Answers

0
votes

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

Change protocol to https for example: authRequest:URLRequest = new URLRequest('https://api.twitter.com/oauth/authorize?oauth_token=' + requestToken.key+'&force_login=true');