We are currently using Kafka version 2.11 and KafakConnect 2.0.0 which is part of the hortonworks distribution we have got. We have enabled Rest API basic authentication by adding this in connect.distributed.properties
listeners=https://${hostname}:${restPort}
and following all the steps mentioned here.
Now everything is working and we are able to use basic auth in all GET and POST operations on the leader node while only GET operations are working on the worker nodes. When we try to do POST operation on worker node we get this Error -
{"error_code":500,"message":"IO Error trying to forward REST request: org.eclipse.jetty.client.HttpResponseException: HTTP protocol violation: Authentication challenge without WWW-Authenticate header"}
As per message its quite evident that the worker is trying to forward the POST/DELETE request to Leader and its failing to do so. A sample DELETE request which is failing is like this:
curl -X DELETE -i -H 'Accept:application/json' -H 'Authorization:Basic base64encodedpassword' https://hostname:18084/connectors/someconnector
Please help if someone has faced this issue before. May be something is wrong in formation of my rest request but it works fine when executed on cluster leader... Thanks
Related
I am using JuPyter hub on K8s. I went through the documentation and had a look at the APIs. Now, I want to use one to start a pod. However, I am unable to start one using this post.
What would be the curl request for this POST request?
I have tried with the given command and it does not work:
curl -XPOST http://some_ip.ap-south-1.elb.amazonaws.com/users/adwait/server
405 : Method Not Allowed
I'm trying to pull data from veracode(json or xml). I tried to use curl to connect to the api but i keep getting the error:"Failed to connect to analysiscenter.veracode.com port 443:Timed out".
curl --compressed -u USERNAME:PASSWORD https://analysiscenter.veracode.com/api/5.0/getapplist.do -F "include_user_info=true"
According to veracode documentation, to connect to the API, one needs to have Reviewer or Security Lead role.I have both Reviewer and Submitter role.The curl command should return some data like this:
xsi:schemaLocation="https://analysiscenter.veracode.com/schema/2.0/applist https://analysiscenter.veracode.com/resource/2.0/applist.xsd" >applist_version="1.2" account_id="123">Code" policy_updated_date="2013-11-11T14:37:34-05:00"/>
create_application_profile="true" create_sandbox="true" >create_new_build="true" assign_app_to_team="true" >assign_app_to_any_team="true" view_sandbox="true" view_results="true" >approve_mitigations="true" submit_static_scan="true"/>
this looks like a network issue, based on the error that you pasted. Can you ping the URL?
CURL also needs some configuration to use SSL. See this answer for some tips:
Configuring cURL for SSL
While running curl to make http post request to skype interviews api, it is hitting an error as 502 - Web server received an invalid response while acting as a gateway or proxy server. There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the conerror in command linetent server.
I am running a command as "curl http://interviews.skype.com/api/interviews -H 'skype-apikey: my api key' -d {}".
By searching, many suggested to check that both IIS versions must be matched, and increase the ARR timeout to 60/120 secs in IIS. Both are not working for this.
Can anyone help me out in using the skype interviews api for performing internal communication like text/audio/video chat, sharing files/screen by any text or video tutorial. Help will be appreciated. Thanx in advance.
Step 1: I have implemented skype interviews API in NodeJs.
First Get your API key and secret:
Step 2: After that create API_KEY and API_SECRET environment variables in the .env file and assign values to them which we got from step 1.
Step 3: Follow the following link for source code to hit skype interviews API endpoint
https://gist.github.com/RajuS1ngh/8729fd8f047a20eed0fe1271c982d122
I want to use rest api( but i don't want to use curl command , i mean i want to use invokehttp procesor for making post commands to delete queue flowfiles and start/stop processor ) I used Autorization Bearer Token like this:
eyJhbGciOiJIUzI1LiJ9.eyJzdWIiOiJzLLRraGlsYWlzaHZpbGlAQ1JBLSdLIiwiaXLzIjoiS2VyYmVyb3LQcm92aWRlciIsImL1ZCI6IStlcmJlcm9zUHJvdmlSZXIiLCJwcmVmZXJyZWRLdXLlcm5hbWUiOiJzLLRraGlsYWlzaHZpbGlAQ1JBLSdLIiwia2lSIjo1LCJleHAiOjE1MDQwMzA2LTQsImlhdCI6MTUwMzS4LzQ1LH0.VxxpvLQbGm3H475g1yScvg5B89WSws3lZUwBrUM4OvE
I have added autorization attribute in invokehttp and added link like this https://server ip/nifi-api/acess/token after this i have added another invokehttp with post command and url like this :https://server ip/nifi-api/flowfile-queues/{id}/drop-requests ( p.s i want to clear queue from flowfile) but first invokehttp shows me exceptions like this :Socket timeout exception and there are several subject i am interested in :
Is it possible that my user doesn't have access to berer token and that's why socket timeout happens? if it is how can i checke this.
if i have secured nifi is it possible to use invokehttp processor without ssl context service to fulfill this accsess/token operation?
Do you have any better idea to rest api without bearer token
except using ssl context service?
socket timeout is a physical error not linked to auth
when auth is activated for nifi then you must use ssl context to access nifi-api
no. if auth activated on server side then client have to pass it.
Does Camel-Http4 supports Basic Authentication?
Followed this and other posts
Camel http4 download file using Basic authentication over Https
I am using camel 2.17.3 version. using camel-http4 component. The route sends a https4 multipart request to a REST endpoint . The REST service is behind the siteminder. Have truststore/ketstore/cert all setup and it works fine, just sending basic auth is causing trouble.
Using postman i was able to call REST services with basic auth. However, all the calls from camel route fails and get HTTP error 403.
I tried below options to get it working:
Added basic auth to the HttpConfiguration - got HTTP error 401
Added "Authorization" header to the route, as mentioned in the above link - got HTTP error 403
and Added method,user,pass to HTTP_Query - 403 also clear text password is visible in the siteminder logs, this is not good, so dropped trying this option.
please help resolve this issue with some working example and explain the cause.
Is camel dropping http headers?
also i now thinking should I consider using other available components netty/jetty/cxf?? But I prefer getting HTTPs4 working :)
thanks
To help others with an working example, here is how I got it...
1) Check the site-minder policy and also ensure the user have correct permissions for the services.
2) Passing user/password as query parameter isn't safe (at least it wasn't in my case) Clear text password was exposed in site-minder.
3) setting header (Authorization)
apache-camel-basic-http-auth