Created 04-21-2017 07:23 PM
Hi,
I am using NiFi on a VM on Azure.
I installed HDF and I am trying to use the processor GetTwitter.
I created a Twitter App (which works, I checked), I configured the server with NTP.
I installed SSL for NiFi, Ranger and Kerberos to handle the connection to the UI.
But I have this error : Received Error HTTP_ERROR : HTTP/1.1 401 Authorization Required
Any idea what is wrong?
Created 04-28-2017 07:39 PM
It happened that I imported a template with the processor GetTwitter and the version of the processor seemed to be old.
I removed it and added a new one from the tool bar.
It works now!
Created 04-21-2017 08:14 PM
Which end point are you using for the processor? You should use the sample or filter endpoint. I don't believe you can use the firehouse endpoint unless you pay Twitter for access.
Created 04-28-2017 02:50 PM
Created 04-28-2017 02:58 PM
Yes, more than likely. You can read more about Twitter TLS here: https://dev.twitter.com/overview/api/tls
Created 04-28-2017 05:33 PM
I added the certificate of twitter (twittercom.crt) in NiFi keystore (with keytool) but get the same error.
Do I have to add it in the keystore or the trustore? I did not find any doc on that.
The error mentions HTTP_ERROR, but if I am using SSL, why is it not HTTPS?
Created on 04-28-2017 05:57 PM - edited 08-17-2019 09:22 PM
A secured NiFi does not force its processor components to be secured. A secured Nifi can communicate with non secure end-points. Security at the processor component level is handled via configuration on the processor itself and never at the NiFi core level.
That being said, I am really not sure what your twitter connection issue is. If the GetTwitter processor did support TLS, I would expect it to have a processor for pointing at a "SSL Context Service" controller service which it does not. It looks like authorization is purely handled via:
You could try putting the twitter processor in debug and see if it produces any additional output in the nifi-app.log that may lead to a cause.
Thanks,
Matt
Created 04-28-2017 06:06 PM
Created 04-28-2017 06:02 PM
I use the Twitter processor pretty often (albeit I am not using SSL) and one thing I have often run into that produces the same error is a copy/paste issue with one of the Key's or Secrets.
Can you try copying your key's and secrets to a text editor and then copy/paste them from there into NiFi.
Thanks,
Andrew
Created 04-28-2017 06:14 PM
I already did and I even tested with another application (in java) and it works.
Do I need to test the connection to Twitter in command line like a ping or something ? I can ping dev.twitter.com
Created 04-28-2017 06:19 PM
Hmm interesting. It appears that you can reach the host just fine if you are getting back a 401. Have you taken the approach @Matt Clarke mentioned ?