How to resolve "401:Authentication credentials (https://dev.twitter.com/pages/auth) were missing or incorrect." exception

How to resolve "401:Authentication credentials (https://dev.twitter.com/pages/auth) were missing or incorrect." exception

book

Article ID: KB0081403

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix BusinessWorks Plug-in for Twitter 1.0.0

Description

When TwitterPublish activity of TIBCO ActiveMatrix BusinessWorks Plug-in for Twitter is executed, it fails to connect to the Twitter server and returns the following exception.​ See attached snapshot. 

401:Authentication credentials (https://dev.twitter.com/pages/auth) were missing or incorrect. Ensure that you have set valid consumer key/secret, access token/secret, and the system clock is in sync.
message - Invalid or expired token.
code - 89
.
    at com.tibco.plugin.twitter.activities.TwitterPublishActivity.postTweet(TwitterPublishActivity.java:209)
    at com.tibco.plugin.twitter.activities.TwitterPublishActivity.eval(TwitterPublishActivity.java:98)
    at com.tibco.pe.plugin.Activity.eval(Unknown Source)
    at com.tibco.pe.core.TaskImpl.eval(Unknown Source)
    at com.tibco.pe.core.Job.a(Unknown Source)
    at com.tibco.pe.core.Job.k(Unknown Source)
    at com.tibco.pe.core.JobDispatcher$JobCourier.a(Unknown Source)
    at com.tibco.pe.core.JobDispatcher$JobCourier.run(Unknown Source)
<?xml version="1.0" encoding="UTF-8"?>

<Data>
    <ns0:TwitterAPIException xmlns:ns0="http://schemas.tibco.com/bw/plugins/twitter/TwitterExceptions">
        <msg>401:Authentication credentials (https://dev.twitter.com/pages/auth) were missing or incorrect. Ensure that you have set valid consumer key/secret, access token/secret, and the system clock is in sync.
message - Invalid or expired token.
code - 89
.</msg>
        <msgCode>BW-TW-100401</msgCode>
    </ns0:TwitterAPIException>
</Data> 

Issue/Introduction

Ensure that all these fields(consumerkey, consumerSecret, accessToken, accessTokenSecret) values are set it correctly.

Environment

All supported platforms

Resolution

This issue occurs due to incorrect consumerkey/consumerSecret, accessToken/accessTokenSecret value which are set under the configuration tab of OAuth 1.0 Resources activity. 

In order to resolve this issue, ensure that all these fields(consumerkey, consumerSecret, accessToken, accessTokenSecret) values are set it correctly. 

Attachments

How to resolve "401:Authentication credentials (https://dev.twitter.com/pages/auth) were missing or incorrect." exception get_app