Implementing Sign in with Twitter

I am trying to implement Twitter sign in in my java web application.

I am following this manual.

  1. I registered my application at here.
  2. But when i am trying to get request_token i am getting Response Code : 401.
    I am using following code to get request_token.

    String userUrl = ““;

    String urlParam = oauth_callback + “&” + oauth_consumer_key + “&” + oauth_nonce + “&”+ oauth_signature + “&” + oauth_signature_method+”&”+oauth_timestamp+”&”+oauth_version;

    URL url = new URL(userUrl);
    HttpURLConnection con = (HttpURLConnection) url.openConnection();

    con.setRequestProperty(“Accept-Language”, “en-US,en;q=0.5”);
    String urlParameters = urlParam;

    DataOutputStream wr = new DataOutputStream(con.getOutputStream());
    int responseCode = con.getResponseCode();

Source: java

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.