Login in xwiki through http client...

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Login in xwiki through http client...

Nithya Vembu
Hi All,

   I just want to know is it possible to login in xwiki application through httpclient. Now through xmlrpc and rest api we can. But for some purpose i need to login through httpclient. If possible, any one can tell the url along with the parameters needed to login.

  Thanks in advance.

Regards,
Nithya.
Reply | Threaded
Open this post in threaded view
|

Re: Login in xwiki through http client...

Simon Glet
Hi,

You could use TcpTrace (http://www.pocketsoap.com/tcpTrace/) to
proxy-forward everything that is going on between your browser and XE.
The tool will allow you to investigate the HTTP messages.

Regards
Simon Glet

On Mon, Mar 1, 2010 at 9:15 AM, Nithya Vembu <[hidden email]> wrote:

>
> Hi All,
>
>   I just want to know is it possible to login in xwiki application through
> httpclient. Now through xmlrpc and rest api we can. But for some purpose i
> need to login through httpclient. If possible, any one can tell the url
> along with the parameters needed to login.
>
>  Thanks in advance.
>
> Regards,
> Nithya.
> --
> View this message in context: http://n2.nabble.com/Login-in-xwiki-through-http-client-tp4654361p4654361.html
> Sent from the XWiki- Users mailing list archive at Nabble.com.
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/users
>
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Login in xwiki through http client...

Florin Ciubotaru
In reply to this post by Nithya Vembu
Hi,

On 3/1/2010 4:15 PM, Nithya Vembu wrote:
> Hi All,
>
>     I just want to know is it possible to login in xwiki application through
> httpclient. Now through xmlrpc and rest api we can. But for some purpose i
> need to login through httpclient. If possible, any one can tell the url
> along with the parameters needed to login.
>    
IMO, this has a lot of downsides and it's not a very reliable solution.
Can you can you give some details about your use case?
AFAIK the login is not shared between the subsystems, so you will not be
able to use the rest or xmlrpc features by logging in with http.
Anyway, to do the login for the standard distribution you need to post
to: /xwiki/bin/loginsubmit/XWiki/XWikiLogin.
The parameters are: j_username, j_password, j_rememberme, and you will
probably want to add xpage=plain and stop the redirects.

 From my experince this kind of approach ends up being quite costly.

Florin Ciubotaru


>    Thanks in advance.
>
> Regards,
> Nithya.
>    

_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Login in xwiki through http client...

Thomas Mortagne
Administrator
In reply to this post by Nithya Vembu
On Mon, Mar 1, 2010 at 15:15, Nithya Vembu <[hidden email]> wrote:
>
> Hi All,
>
>   I just want to know is it possible to login in xwiki application through
> httpclient. Now through xmlrpc and rest api we can. But for some purpose i
> need to login through httpclient. If possible, any one can tell the url
> along with the parameters needed to login.

See http://svn.xwiki.org/svnroot/xwiki/enterprise/trunk/distribution-test/webstandards-tests/src/test/it/com/xpn/xwiki/it/XHTMLValidationTest.java

And the method #testDocumentValidity

the important part is

method.setDoAuthentication(true);
method.setFollowRedirects(true);
method.addRequestHeader("Authorization", "Basic " + new
String(Base64.encodeBase64("Admin:admin".getBytes())));


>
>  Thanks in advance.
>
> Regards,
> Nithya.
> --
> View this message in context: http://n2.nabble.com/Login-in-xwiki-through-http-client-tp4654361p4654361.html
> Sent from the XWiki- Users mailing list archive at Nabble.com.
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/users
>



--
Thomas Mortagne
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Login in xwiki through http client...

Nithya Vembu
In reply to this post by Florin Ciubotaru
Hi All,

   Thanks for you valuable response.

  I am asking the httpclient for doing my own sso login.

  I am using JBoss portal which using OpenSSO -> OpenDS as a user datastore. The same user get store in both JForum application's seperate database and also in xwiki database.

  In JForum i followed this approach to do the single sign on.
  1. Check for my LTPA token cookie.
  2. If its there i will get the user details with username and password from OpenSSO and do the login in jforum through the http client to maintain the user in session.
  3. Add a cookie for JForum application.
  (The user will be in session till the LTPA token get expire).

But i am not getting clear idea about implementation of my own sso in xwiki.  Any solution please suggest.

Thanks,
Nithya.
Reply | Threaded
Open this post in threaded view
|

Re: Login in xwiki through http client...

Thomas Mortagne
Administrator
On Mon, Mar 1, 2010 at 18:08, Nithya Vembu <[hidden email]> wrote:

>
> Hi All,
>
>   Thanks for you valuable response.
>
>  I am asking the httpclient for doing my own sso login.
>
>  I am using JBoss portal which using OpenSSO -> OpenDS as a user datastore.
> The same user get store in both JForum application's seperate database and
> also in xwiki database.
>
>  In JForum i followed this approach to do the single sign on.
>  1. Check for my LTPA token cookie.
>  2. If its there i will get the user details with username and password
> from OpenSSO and do the login in jforum through the http client to maintain
> the user in session.
>  3. Add a cookie for JForum application.
>  (The user will be in session till the LTPA token get expire).
>
> But i am not getting clear idea about implementation of my own sso in xwiki.

No need, you can find an sunsso/opensso authenticator on
http://svn.xwiki.org/svnroot/xwiki/contrib/sandbox/xwiki-authenticator-sunsso/
;)

> Any solution please suggest.
>
> Thanks,
> Nithya.
> --
> View this message in context: http://n2.nabble.com/Login-in-xwiki-through-http-client-tp4654361p4655517.html
> Sent from the XWiki- Users mailing list archive at Nabble.com.
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/users
>



--
Thomas Mortagne
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users