You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by sharathbabuk <sh...@hotmail.com> on 2014/10/29 19:42:46 UTC
Re: HTTP Basic Authentication
The preemptive authentication with HTTPS does not seem to work with
"Camel-Http"
It works only with "camel-http4"
But I have a limitation on my container ( websphere application server 7.x )
so cannot use "camel-http4" - does anyone know if this should work with
"camel-http" ??
== here is my camel XML DSL ======
<camel:sslContextParameters id="sslContextParameters">
<camel:keyManagers keyPassword="{{ssl.store.pass}}">
<camel:keyStore resource="{{ssl.store.path}}"
password="{{ssl.store.pass}}" />
</camel:keyManagers>
</camel:sslContextParameters>
<setHeader headerName="CamelHttpMethod">
<constant>POST</constant>
</setHeader>
<setHeader headerName="Content-Type">
<constant>application/json</constant>
</setHeader>
<setExchangePattern pattern="InOut" />
<to
uri="https:{{host}}{{auditWs.url}}?sslContextParameters=sslContextParameters%26authUsername={{auditWsAuthUsername}}%26authPassword={{auditWsAuthPassword}}%26authenticationPreemptive=true%26bridgeEndpoint=true%26throwExceptionOnFailure=false"
===
I get a 401 ERROR when I use "camel-http"
--
View this message in context: http://camel.465427.n5.nabble.com/HTTP-Basic-Authentication-tp5742229p5758314.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: HTTP Basic Authentication
Posted by Joakim Bjørnstad <jo...@gmail.com>.
Hello,
Are you using the http component?
http://camel.apache.org/http.html
There is a section on authentication there.
Example:
from("http://examples.com/rest/hello?"
+ "authMethod=Basic"
+ "&authUsername=User"
+ "&authPassword=Password")
.to("mock:answer");
On Thu, Oct 1, 2015 at 1:29 PM, zied123456 <zi...@gmail.com> wrote:
> Hello,
> I try to send request to a webservice with camel and i dont found how to
> set
> httplogin and httppass with
> POJO i can do this:
>
> final String s = my_httpLogin+":"+my_httpPwd;
> final byte[] authBytes = s.getBytes(StandardCharsets.UTF_8);
> final String encoded = Base64.getEncoder().encodeToString(authBytes);
>
> and i set it in the header like this:
>
> con.setRequestProperty("Authorization", "Basic " + encoded);
>
> How can i do this with Camel Route ?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/HTTP-Basic-Authentication-tp5742229p5772150.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
--
Kind regards
Joakim Bjørnstad
Re: HTTP Basic Authentication
Posted by zied123456 <zi...@gmail.com>.
Hello,
I try to send request to a webservice with camel and i dont found how to set
httplogin and httppass with
POJO i can do this:
final String s = my_httpLogin+":"+my_httpPwd;
final byte[] authBytes = s.getBytes(StandardCharsets.UTF_8);
final String encoded = Base64.getEncoder().encodeToString(authBytes);
and i set it in the header like this:
con.setRequestProperty("Authorization", "Basic " + encoded);
How can i do this with Camel Route ?
--
View this message in context: http://camel.465427.n5.nabble.com/HTTP-Basic-Authentication-tp5742229p5772150.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: HTTP Basic Authentication
Posted by Willem Jiang <wi...@gmail.com>.
Please setup the option of httpClient.authenticationPreemptive to be true.
You can find more information here[1] by searching authenticationPreemptive.
[1]https://camel.apache.org/http
--
Willem Jiang
Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang
Weibo: 姜宁willem
On October 30, 2014 at 2:52:55 AM, sharathbabuk (sharathbabuk@hotmail.com) wrote:
> The preemptive authentication with HTTPS does not seem to work with
> "Camel-Http"
> It works only with "camel-http4"
>
> But I have a limitation on my container ( websphere application server 7.x )
> so cannot use "camel-http4" - does anyone know if this should work with
> "camel-http" ??
>
> == here is my camel XML DSL ======
>
>
>
>
> > password="{{ssl.store.pass}}" />
>
>
>
>
> POST
>
>
> application/json
>
>
> > uri="https:{{host}}{{auditWs.url}}?sslContextParameters=sslContextParameters%26authUsername={{auditWsAuthUsername}}%26authPassword={{auditWsAuthPassword}}%26authenticationPreemptive=true%26bridgeEndpoint=true%26throwExceptionOnFailure=false"
>
> ===
> I get a 401 ERROR when I use "camel-http"
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/HTTP-Basic-Authentication-tp5742229p5758314.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>