ishkin / Proton

IBM Proactive Technology Online
24 stars 21 forks source link

REST output authentication error #26

Closed marc0f closed 8 years ago

marc0f commented 8 years ago

Hi, I'm training to send an output event from FIWARE CEP (Proton), using the REST consumer, to an ActiveMQ queue. The credential for access the ActiveMQ queue are included in the URL, as http://user:passwrd@X.X.X.X:xxxx/api/message/myqueue, but I have the following error:

com.ibm.hrl.proton.webapp.resources.EventResource submitNewEvent INFO: events sent to proton runtime... org.apache.commons.httpclient.auth.AuthChallengeProcessor selectAuthScheme INFO: basic authentication scheme selected org.apache.commons.httpclient.HttpMethodDirector processWWWAuthChallenge INFO: No credentials available for BASIC 'ActiveMQRealm'@X.X.X.X com.ibm.hrl.proton.server.executorServices.SimpleThreadFactory$ProtonExceptionHandler uncaughtException SEVERE: Uncaught exception in thread: Thread[4,5,main],exception: com.ibm.hrl.proton.adapters.rest.client.RESTException: com.ibm.hrl.proton.adapters.rest.client.RESTException: Could not perform POST of event instance: ... with request headers: Content-Type: text/plain User-Agent: Jakarta Commons-HttpClient/3.0 Host: X.X.X.X:xxxx Content-Length: 389 to consumer http://user:passwrd@X.X.X.X:xxx/api/message/myqueue, responce result: 401

Seems like that Proton doesn't extract the credential from the URL.

Thanks, Marco

talhaham commented 8 years ago

.Currently the CEP Rest service doesn't support authentication

2015-12-16 12:38 GMT+02:00 Marco notifications@github.com:

Hi, I'm training to send an output event from FIWARE CEP (Proton), using the REST consumer, to an ActiveMQ queue The credential for access the ActiveMQ queue are included in the URL, as http://user:passwrd@XXXX:xxxx/api/message/myqueue, but I have the following error:

comibmhrlprotonwebappresourcesEventResource submitNewEvent INFO: events sent to proton runtime orgapachecommonshttpclientauthAuthChallengeProcessor selectAuthScheme INFO: basic authentication scheme selected orgapachecommonshttpclientHttpMethodDirector processWWWAuthChallenge INFO: No credentials available for BASIC 'ActiveMQRealm'@XXXX https://github.com/XXXX comibmhrlprotonserverexecutorServicesSimpleThreadFactory$ProtonExceptionHandler uncaughtException SEVERE: Uncaught exception in thread: Thread[4,5,main],exception: comibmhrlprotonadaptersrestclientRESTException: comibmhrlprotonadaptersrestclientRESTException: Could not perform POST of event instance: with request headers: Content-Type: text/plain User-Agent: Jakarta Commons-HttpClient/30 Host: XXXX:xxxx Content-Length: 389 to consumer http://user:passwrd@XXXX:xxx/api/message/myqueue, responce result: 401

Seems like that Proton doesn't extract the credential from the URL

Thanks, Marco

— Reply to this email directly or view it on GitHub https://github.com/ishkin/Proton/issues/26.

fabioformosa commented 8 years ago

Does Orion support REST authentication to send events to a subscriber? Or... is there an alternative way to REST Service for CEP to get authenticated channel?

talhaham commented 8 years ago

You can add to the CEP REST consumer definition an AuthToken parameter. From the CEP user guide :

AuthToken – an optional parameter. When set, it is added as an X-Auth-Token HTTP header of the request

This option was used when the CEP communicated with Orion and Orion needed the AuthToken.

I'm not familiar enough with Orion to know the way it supports AuthToken when it sends notifications.

2015-12-17 11:55 GMT+02:00 fabioformosa notifications@github.com:

Does Orion support REST authentication to send events to a subscriber? Or... is there an alternative way to REST Service for CEP to get authenticated channel?

— Reply to this email directly or view it on GitHub https://github.com/ishkin/Proton/issues/26#issuecomment-165404142.

urishani commented 8 years ago

Closing due to inactivity. A new feature for authentication has been added to Proton. Not planned yet.