Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Apache Nifi with web service

Apache Nifi with web service

I'm trying to access a https site that has informations I'm intrested at. The probleme is it needs authentification to access the site. 

With InvokeHTTP, we only can have the Basic Authentification that I don't even know what stands for, but inserting my logging identification, nothing changes. and I have a Access denied to that site.

I've looking for answer about a week ago, and I can't seem to find the answer anywhere, 
That's why I'm asking you guys for help.

Thank you in advance.

5 REPLIES 5

Re: Apache Nifi with web service

hey stevenmatisson, I appreciate the quick answer. Sorry I couldn't get back to you soon.
when I configure the SSLContextService. they ask me about truestore filename/key, and keystore filename/key,
I only used the keystore properties :
Capture.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

as a password I insert : changeit (the default password)
and then I got this error in my InvokeHTTP
error capture.PNG

and it got me stuck with no solution.

Are you familiar with this error?
Thank you in advance.

Re: Apache Nifi with web service

Super Collaborator

You will need to setup the keystore and truststore completely.  To do this you need the public ssl cert from the https service you are connecting too.   In my examples below replace [bracketedtext] with your real information w/o brackets.   You can use commandline to get the public cert: 

 

openssl s_client -showcerts -connect [servicehostname.com]:443

 

copy from 

-----BEGIN CERTIFICATE-----

through

-----END CERTIFICATE-----

 

Once you the cert save it to a local file, creating the keystore and truststore is then as follows:

 

/usr/jdk64/jdk1.8.0_112/bin/keytool -import -file [https-service-cert] -alias ambari -keystore

/etc/nifi/conf/truststore.jks

 
/usr/jdk64/jdk1.8.0_112/bin/keytool -import -trustcacerts -alias nifi -file [https-service-cert] -keystore

/etc/nifi/conf/keystore.jks

 

make sure the files are chown nifi:nifi :

 

chown nifi:nifi /etc/nifi/conf/*.jks

 

 

When you configure the Nifi Controller Service, enter the password you used when you created the files above.  You can likely leave "key password" blank.  The types will be JKS.   Once the Controller Service is enabled (without any issues), then try to use it in the NiFi Processor.

 

 

 

 

 

Re: Apache Nifi with web service

Thank you for your response again. it's very helpful so far.
I followed your instructions step by step. 
when running the Nifi processor I get this error,
Capture.PNG

my Nifi processor has as a proxy type : HTTPS. I'm trying to access the list of projects in my Project Online. 
My url is : https://[....].sharepoint.com/sites/pwa/_api/ProjectData/Projects
it's only right to choose https as a proxy type. but, I get this error: It's like, I'm calling a http url and i'm forcing the https as a proxy type.
it's clearly not the case, I don't understand what the problem is. and why nifi is forcing http as proxy type. 
when I change it to http (the proxy type without changing my URL), I get the access denied msg from microsoft (as detailed in the picture below) :

Capture.PNG

I'm still very lost in this, I might need some extra help please.
Thank you in advance.

Re: Apache Nifi with web service

I didnt precised that I did not configure my nifi.properties nor any file in Nifi reportory. Is it a must for https to work or to be called in from nifi?

Don't have an account?
Coming from Hortonworks? Activate your account here