Sergiu Dumitriu-2 wrote:
XWiki authenticates using cookies. You could duplicate the code that adds the right cookies (com.xpn.xwiki.user.impl.xwiki.MyPersistentLoginManager#rememberLogin) into your application, and XWiki will automatically see them and login the right user. Don't forget to remove those cookies on logout (#forgetLogin).
Hi, Thankyou for the reply. I tried to reuse the code from (com.xpn.xwiki.user.impl.xwiki.MyPersistentLoginManager#rememberLogin) I found that it requires two variables to be set beforehand, which I believe would come from xwiki.cfg. These are this.secretkey and this.validationkey So, I tried to instantiate them myself in myProject for secretkey, I did following byte[] theKey = stringToHex("secret").getBytes(); KeySpec ks = new DESKeySpec(theKey); SecretKeyFactory kf = SecretKeyFactory.getInstance("DES"); this.secretKey = kf.generateSecret(ks); Since validationkey was just a string, I did following this.validationKey = "validt"; Then I edited the xwiki.cfg file of my xwiki installation xwiki.authentication.validationKey=validt xwiki.authentication.encryptionKey=secret After loggin into the system, I found that cookies are set. However that user aren't automatically logged in xwiki. I'm sure I've been missing something in the process. Can you please looked into it and identify it. Thankyou, Manish -- View this message in context: http://xwiki.475771.n2.nabble.com/Single-sign-on-tp5299320p5303069.html Sent from the XWiki- Users mailing list archive at Nabble.com.