Help in oauth/request_token


#1

Hi,

I am getting 401 error for request_token api({errors: [{code: 32, message: “Could not authenticate you.”}]})

Can anyone please help me find out the problem.

       return $http({
            method: 'post',
            url: 'https://api.twitter.com/oauth/request_token', 
            headers: {
               'Authorization': 'OAuth oauth_callback="http%3A%2F%2Flocalhost%3A7777%2Fportalserver%2Fgarimatest%2Findex", oauth_consumer_key="Exxxxxxnf9cV", oauth_nonce="kYjzxxxxxxS4cg", oauth_signature="9bfbxxxx249255a", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1494356896",   oauth_version="1.0"'
            }
        });
    }

Thanks!


#2

Have you tried one of the established client libraries for your chosen development language, instead of attempting to implement the OAuth flow yourself? That would make it much simpler.

Otherwise, be aware that OAuth is time-sensitive, so you should make sure your server’s time is accurate.