Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Error Webhook config unable to be retrieved #10

Open
unkn0wnU53r opened this issue Mar 22, 2019 · 3 comments
Open

Error Webhook config unable to be retrieved #10

unkn0wnU53r opened this issue Mar 22, 2019 · 3 comments

Comments

@unkn0wnU53r
Copy link

Error Webhook config unable to be retrieved

Getting an error as outlined above when i click on Manage Webhooks. i am not sure what that implies. Permission of the config. json file set to 777 error still persists. How can i solve ths issue.
The json respone seen in the cli indicates Error: Code 32 Message: Could not authenticate you. I am sure the Apps Access permission and Keys, secret keys and access tokens are right and properly set in the config.json aswell as the TWITTER_WEBHOOK_ENV and Callback URLs.

Do those different Error messages point to the same Problem?

How do i start solving this facer? Where should i start what should i do next?

Any help appreciated. Many thanks in advance.

PS: i feel like it is unsettling that the "Dev environment label" in the documentation is referred to as "envoirment name". Maybe that should be changed for a clearer naming consistency.

@gkimpson
Copy link
Contributor

Did you figure out what was causing this error message?

@lchinitz
Copy link

lchinitz commented Aug 30, 2019

I have a similar problem, but a different error. I have tried everything I can think of, and am hoping someone has a suggestion. I am confident that my keys/tokens are correct, but when I use the dashboard to create the webhook, I get this message:

Webhook URL does not meet the requirements. Invalid CRC token or json response format.

I was thinking that it was just the format of the response, but I have tried a whole bunch of things, based on the python example, and so far, no luck. My server is node.js, and here's the code. The request is definitely getting there (I can see it in the logs) but the return is apparently bad.

I'm using the crypto library to create the hmac (again, as in the example provided here.)

function twitterWebhook(req, res, next)
{
    my.logger.verbose('Entered the Twitter Webhook');
    my.logger.verbose('Here is the url:  ' + JSON.stringify(req.url));
    my.logger.verbose('Here is the query:  ' + JSON.stringify(req.query));

    var crc_token = req.query.crc_token;

    my.logger.verbose('crc_token is:  ' + crc_token);
    my.logger.verbose('secret is   :  ' + conf.T_consumer_secret);

    var hmac = crypto.createHmac('sha256', conf.T_consumer_secret).update(crc_token).digest('base64');
    my.logger.verbose('hmac is     :  ' + hmac);

    if (req.method.toLowerCase() == 'get'){
        var aResponse = {response_token:hmac};
        var aResponseString = JSON.stringify(aResponse);
        my.logger.verbose('Responding with   :  ' + aResponseString);
        res.json(aResponseString);
        //res.json(hmac);
    }
return;

@rkalra1996
Copy link

I have had a similar issue. From what i can understand, it could be possible that your node server is taking more than 3 secs to return the sha256 token for crc verification. It is written in the requirements of setting up a webhook. Do verify if its true

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants