Question

I have a Twitter REST API-Android application. When user clicks Sign in with Twitter I run a GET authorize/authenticate and redirect user to https://api.twitter.com/oauth/authenticate?oauth_token=aaa123

  • If user is already logged in, Twitter page asks user for authorization. Everything is fine.
  • If user isn't logged in, on top of the page this text appears:

    "Something is technically wrong" "wrong username or password"

    And Twitter page asks user to fill username and password. My visitors complains about this warning on top. They say that they even didn't fill their username and password but Twitter page says that wrong password. What creates this alert ? How can I prevent it ? Should I add more parameters in authorize/authenticate ?

After user fills username and password, auth flow finishes successfully. But I need to disable false error.

(I don't get this error on mobile browsers or desktop browsers. Only in mobile app)

Was it helpful?

Solution 2

I solved my problem. The problem is loading Twitter auth page.

When I use this I get "wrong username or password" error:

webView.postUrl("https://api.twitter.com/oauth/authenticate?oauth_token=aaa123",
        EncodingUtils.getBytes(data, "base64"));

I don't get this error for this type of call:

webView.loadUrl("https://api.twitter.com/oauth/authenticate?oauth_token=aaa123");

OTHER TIPS

I recommend you to use Twitter4j library for the integration of Twitter within your Android Application.
Because this Library encapsulates all the Authentication, Tweeting, Fetching Tweets, etc chores within itself. And we have to just call simple methods from this Library for using these features in our Android App.

Twitter4J features:
✔ 100% Pure Java - works on any Java Platform version 5 or later
✔ Android platform and Google App Engine ready
✔ Zero dependency : No additional jars required
✔ Built-in OAuth support
✔ Out-of-the-box gzip support
✔ 100% Twitter API 1.1 compatible

You can follow this url for further information related to Twutter4j :
http://twitter4j.org/en/index.html
I hope this helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top