You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@abdera.apache.org by herbert <io...@gmx.de> on 2007/09/14 17:50:13 UTC

How to configure AbderaClient to *not* use an Authentication Scheme?

Hi all!

I have some AbderaClient-example-code, running in a Websphere-Portal-6,
posting an atom-entry to a Lotus-Connections-Server.

All runs well, if I use Basic-authentication and so a fixed user, given by
the hardcoded UsernamePasswordCredentials("myuser", "mypass"));	

But my target is using the current-portal-user and provide a
single-sign-on-funcionality with LTPA.

How do I have to configure the AbderaClient, to get this working?

If I won't use AbderaClient or HttpClient I just would build a
HTTP-Post-Request, I would not set the 
"authorization"-header and would put a Cookie Ltpa in the request, ready. 

When using AbderaClient I have the problem, that AbderaClient or HTTPClient
per default thinks, 
it has to use Basic-Authentication, if I don't provide an
"authorization"-header.

My current work-around is to set anyone unknown String as an
authorization-header,
so the default-behaviour is omitted. Like:
requestOptions.setAuthorization("SOMENONSENSESTRING");

IMO the resulting request looks good, but the whole thing is not working.

Maybe there is a better way to get AbderaClient and/or HttpClient
working with LTPA as mine described above?

Regards,

Herbert




-- 
View this message in context: http://www.nabble.com/How-to-configure-AbderaClient-to-*not*-use-an-Authentication-Scheme--tf4443484.html#a12678292
Sent from the abdera-user mailing list archive at Nabble.com.


Re: How to configure AbderaClient to *not* use an Authentication Scheme?

Posted by James M Snell <ja...@gmail.com>.
In Abdera, the "CommonsClient" (now called AbderaClient in 0.3.0) is a
wrapper for the Apache HttpClient.

- James

herbert wrote:
> Hi James!
> 
> 
> James M Snell wrote:
>> Herbert, here's the answer I got back from the Activities folks.
>>
>> Unfortunately, CommonsClient (AbderaClient in 0.3.0) does not expose a
>> method for setting cookies manually like this.  It will retain cookies
>> that are returned by the server, however, so if you use Abdera to
>> authenticate and get a LTPA cookie back, it should be automatically
>> reused.
>>
> 
> Thanks for the efforts! I would like to have this "hot wire" to the
> activities-team too! ;-)
> 
> I can work around the issue by providing RequestOptions like this:
> requestOptions.addHeader("Cookie", "LtpaToken="+ltpa);
> I don't have to set an authorization-header, so this works well for me.
> 
> One thing in your answer slightly irritates me:
> Is there a "Apache HttpClient" and a "CommonsClient"?
> Where's the difference?
> 
> Regards, Herbert
> 
> 
> -------- Original Message --------
> [snip]
> From: 	Andy Myers <--->
> [snip]
> 
> 
> James,
> 
> The Notes 8 Activities sideshelf can use either basic authentication or
> an LTPA token. Underlying the implementation is the Apache HttpClient,
> and the only code change is to use
> 
> _http.getState().setCredentials(AuthScope.ANY,  new
> UsernamePasswordCredentials(userName, userPassword));
> 
> in one case, and
> 
> _http.getState().addCookies(ssotokens);
> 
> in the other. I am not sure how this maps to the CommonsClient used by
> Abdera, but I guess it should be pretty similar.
> 
> Regards,
> Andy.
> [snip]
> 
> 
> herbert wrote:
>> Hi James!
>>
>>
>> James M Snell wrote:
>>> Hey Herbert, I forwarded the note on to one of the Connections
>>> developers that has experience using Abdera as a client.  She should be
>>> getting back to you soon.
>>>
>> This would be great! Thanks!
> 
> 
> 

Re: How to configure AbderaClient to *not* use an Authentication Scheme?

Posted by herbert <io...@gmx.de>.
Hi James!


James M Snell wrote:
> 
> Herbert, here's the answer I got back from the Activities folks.
> 
> Unfortunately, CommonsClient (AbderaClient in 0.3.0) does not expose a
> method for setting cookies manually like this.  It will retain cookies
> that are returned by the server, however, so if you use Abdera to
> authenticate and get a LTPA cookie back, it should be automatically
> reused.
> 

Thanks for the efforts! I would like to have this "hot wire" to the
activities-team too! ;-)

I can work around the issue by providing RequestOptions like this:
requestOptions.addHeader("Cookie", "LtpaToken="+ltpa);
I don't have to set an authorization-header, so this works well for me.

One thing in your answer slightly irritates me:
Is there a "Apache HttpClient" and a "CommonsClient"?
Where's the difference?

Regards, Herbert


-------- Original Message --------
[snip]
From: 	Andy Myers <--->
[snip]


James,

The Notes 8 Activities sideshelf can use either basic authentication or
an LTPA token. Underlying the implementation is the Apache HttpClient,
and the only code change is to use

_http.getState().setCredentials(AuthScope.ANY,  new
UsernamePasswordCredentials(userName, userPassword));

in one case, and

_http.getState().addCookies(ssotokens);

in the other. I am not sure how this maps to the CommonsClient used by
Abdera, but I guess it should be pretty similar.

Regards,
Andy.
[snip]


herbert wrote:
> Hi James!
> 
> 
> James M Snell wrote:
>> Hey Herbert, I forwarded the note on to one of the Connections
>> developers that has experience using Abdera as a client.  She should be
>> getting back to you soon.
>>
> 
> This would be great! Thanks!



-- 
View this message in context: http://www.nabble.com/How-to-configure-AbderaClient-to-*not*-use-an-Authentication-Scheme--tf4443484.html#a12777485
Sent from the abdera-user mailing list archive at Nabble.com.


Re: How to configure AbderaClient to *not* use an Authentication Scheme?

Posted by James M Snell <ja...@gmail.com>.
Herbert, here's the answer I got back from the Activities folks.

Unfortunately, CommonsClient (AbderaClient in 0.3.0) does not expose a
method for setting cookies manually like this.  It will retain cookies
that are returned by the server, however, so if you use Abdera to
authenticate and get a LTPA cookie back, it should be automatically reused.

- James

-------- Original Message --------
[snip]
From: 	Andy Myers <--->
[snip]


James,

The Notes 8 Activities sideshelf can use either basic authentication or
an LTPA token. Underlying the implementation is the Apache HttpClient,
and the only code change is to use

_http.getState().setCredentials(AuthScope.ANY,  new
UsernamePasswordCredentials(userName, userPassword));

in one case, and

_http.getState().addCookies(ssotokens);

in the other. I am not sure how this maps to the CommonsClient used by
Abdera, but I guess it should be pretty similar.

Regards,
Andy.
[snip]


herbert wrote:
> Hi James!
> 
> 
> James M Snell wrote:
>> Hey Herbert, I forwarded the note on to one of the Connections
>> developers that has experience using Abdera as a client.  She should be
>> getting back to you soon.
>>
> 
> This would be great! Thanks!

Re: How to configure AbderaClient to *not* use an Authentication Scheme?

Posted by herbert <io...@gmx.de>.
Hi James!


James M Snell wrote:
> 
> Hey Herbert, I forwarded the note on to one of the Connections
> developers that has experience using Abdera as a client.  She should be
> getting back to you soon.
> 

This would be great! Thanks!
-- 
View this message in context: http://www.nabble.com/How-to-configure-AbderaClient-to-*not*-use-an-Authentication-Scheme--tf4443484.html#a12697300
Sent from the abdera-user mailing list archive at Nabble.com.


Re: How to configure AbderaClient to *not* use an Authentication Scheme?

Posted by James M Snell <ja...@gmail.com>.
Hey Herbert, I forwarded the note on to one of the Connections
developers that has experience using Abdera as a client.  She should be
getting back to you soon.

- James

herbert wrote:
> Hi all!
> 
> I have some AbderaClient-example-code, running in a Websphere-Portal-6,
> posting an atom-entry to a Lotus-Connections-Server.
> 
> All runs well, if I use Basic-authentication and so a fixed user, given by
> the hardcoded UsernamePasswordCredentials("myuser", "mypass"));	
> 
> But my target is using the current-portal-user and provide a
> single-sign-on-funcionality with LTPA.
> 
> How do I have to configure the AbderaClient, to get this working?
> 
> If I won't use AbderaClient or HttpClient I just would build a
> HTTP-Post-Request, I would not set the 
> "authorization"-header and would put a Cookie Ltpa in the request, ready. 
> 
> When using AbderaClient I have the problem, that AbderaClient or HTTPClient
> per default thinks, 
> it has to use Basic-Authentication, if I don't provide an
> "authorization"-header.
> 
> My current work-around is to set anyone unknown String as an
> authorization-header,
> so the default-behaviour is omitted. Like:
> requestOptions.setAuthorization("SOMENONSENSESTRING");
> 
> IMO the resulting request looks good, but the whole thing is not working.
> 
> Maybe there is a better way to get AbderaClient and/or HttpClient
> working with LTPA as mine described above?
> 
> Regards,
> 
> Herbert
> 
> 
> 
>