Re: [xwiki-users] Single sign on
I got it right. For some reason, I thought I had to convert the key to HEX. I was wrong. I changed the code like below and it worked... :) for secretkey, String secret = titititititititititititititititi; (the one from xwiki.cfg) byte[] theKey = secret.getBytes(); KeySpec ks = new DESKeySpec(theKey); SecretKeyFactory kf = SecretKeyFactory.getInstance(DES); this.secretKey = kf.generateSecret(ks); Thanks, Manish -- View this message in context: http://xwiki.475771.n2.nabble.com/Single-sign-on-tp5299320p5309729.html Sent from the XWiki- Users mailing list archive at Nabble.com. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] Single sign on
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. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] Single sign on
Sergiu Dumitriu-2 wrote: Actually, it says this in xwiki.cfg, above the keys: #-# Cookie encryption keys. You SHOULD replace these values with any random string, #-# as long as the length is the same. So you should generate keys with 32 characters. I mis-interpreted it. I thought it meant there could be any two strings as long as the length of those two strings are same. Anyways, I changed it to the default key provided by xwiki and followed the same procedure that I did earlier using those keys. But it still isn't working. -Manish -- View this message in context: http://xwiki.475771.n2.nabble.com/Single-sign-on-tp5299320p5303683.html Sent from the XWiki- Users mailing list archive at Nabble.com. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
[xwiki-users] Single sign on
I have two different applications - myProject and Xwiki running on tomcat server. I have iframe in myProject that displays the xwiki.I made the look and feel much similiar so that it feel like same app to the user. I'm using REST APIs to communicate between two apps. I've made the application such that if the user is created in myProject, the same user gets created in XWiki too. Now, I wanted to make the application such that if the user logs in myProject, he/she will be automatically logged in the xwiki. Can this be achieved? Any help will be greatly appreciated. Thankyou in advance, xManish -- View this message in context: http://xwiki.475771.n2.nabble.com/Single-sign-on-tp5299320p5299320.html Sent from the XWiki- Users mailing list archive at Nabble.com. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] Altering Access Rights from REST Api
Fabio Mancinelli-4 wrote: So as long as what you want to do is achievable by page and object manipulation (like the most of the XWiki functionalities) you are able to use the REST api to do it. Hi Fabio, Thanks for replying to my thread. Coming to the creating user issue. Does that mean we can create a user by creating a page and have object of class XWikiUser, but won't be able to add the user details like personal information and contact information through REST Api? Or may be there is a way to do it?? Thanks, Manish -- View this message in context: http://xwiki.475771.n2.nabble.com/Altering-Access-Rights-from-REST-Api-tp5210826p5215426.html Sent from the XWiki- Users mailing list archive at Nabble.com. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] How to add a page with contents in xwiki through Rest api???
I think I will have to apologize the original creator of this thread for using it to discuss my issue. Jerome, could you please join me in the another thread that I've created for this issue. Its 'Create User in XWiki from REST Api' under XWiki-Dev. THankyou, manish -- View this message in context: http://xwiki.475771.n2.nabble.com/How-to-add-a-page-with-contents-in-xwiki-through-Rest-api-tp4520594p5211253.html Sent from the XWiki- Users mailing list archive at Nabble.com. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] How to add a page with contents in xwiki through Rest api???
I might really have to apologize to the main creator of this thread for using the thread. Jerome, I'll start a new thread on this topic. Adding user through Rest Api. Would you please join me there? -- View this message in context: http://xwiki.475771.n2.nabble.com/How-to-add-a-page-with-contents-in-xwiki-through-Rest-api-tp4520594p5206169.html Sent from the XWiki- Users mailing list archive at Nabble.com. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
[xwiki-users] Adding user through Rest API
I added page in the xwiki through Rest Api in following way. Would somebody please advise me how to add user to the xwiki system in the similiar way. public void add() { final String CONTENT = Content 101; final String TITLE = Title 101; final String PARENT = Private.WebHome; ObjectFactory objectFactory = new ObjectFactory(); Page page = objectFactory.createPage(); page.setContent(CONTENT); page.setTitle(TITLE); page.setParent(PARENT); HttpClient httpClient = new HttpClient(); httpClient.getState().setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(admin, admin)); httpClient.getParams().setAuthenticationPreemptive(true); JAXBContext context; try { context = JAXBContext.newInstance(org.xwiki.rest.model.jaxb); Marshaller marshaller = context.createMarshaller(); Unmarshaller unmarshaller = context.createUnmarshaller(); PutMethod putMethod = new PutMethod(http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Private/pages/NewPage001;); putMethod.addRequestHeader(Accept, MediaType.APPLICATION_XML.toString()); StringWriter writer = new StringWriter(); marshaller.marshal(page, writer); RequestEntity entity; entity = new StringRequestEntity(writer.toString(), MediaType.APPLICATION_XML.toString(), UTF-8); putMethod.setRequestEntity(entity); httpClient.executeMethod(putMethod); } catch (JAXBException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (UnsupportedEncodingException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (HttpException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } -- View this message in context: http://xwiki.475771.n2.nabble.com/Adding-user-through-Rest-API-tp5206186p5206186.html Sent from the XWiki- Users mailing list archive at Nabble.com. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] How to add a page with contents in xwiki through Rest api???
Hi Jerome, Ya of course having /wikis/{wikiName}/users would have been nice. :) But coming to reality, I still have the problem creating user. Here is the code on how I created the wiki page. Can you advise me how to create the wiki user in the similiear manner? public void myAddMethod() { final String CONTENT = Content 101; final String TITLE = Title 101; final String PARENT = Private.WebHome; ObjectFactory objectFactory = new ObjectFactory(); Page page = objectFactory.createPage(); page.setContent(CONTENT); page.setTitle(TITLE); page.setParent(PARENT); HttpClient httpClient = new HttpClient(); httpClient.getState().setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(admin, admin)); httpClient.getParams().setAuthenticationPreemptive(true); JAXBContext context; try { context = JAXBContext.newInstance(org.xwiki.rest.model.jaxb); Marshaller marshaller = context.createMarshaller(); Unmarshaller unmarshaller = context.createUnmarshaller(); PutMethod putMethod = new PutMethod(http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Private/pages/NewPage01;); putMethod.addRequestHeader(Accept, MediaType.APPLICATION_XML.toString()); StringWriter writer = new StringWriter(); marshaller.marshal(page, writer); RequestEntity entity; entity = new StringRequestEntity(writer.toString(), MediaType.APPLICATION_XML.toString(), UTF-8); putMethod.setRequestEntity(entity); httpClient.executeMethod(putMethod); } catch (JAXBException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (UnsupportedEncodingException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (HttpException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } -- View this message in context: http://xwiki.475771.n2.nabble.com/How-to-add-a-page-with-contents-in-xwiki-through-Rest-api-tp4520594p5206709.html Sent from the XWiki- Users mailing list archive at Nabble.com. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] How to add a page with contents in xwiki through Rest api???
Jerome Velociter wrote: Hi Nithya, Manish Have you checked http://platform.xwiki.org/xwiki/bin/view/Features/XWikiRESTfulAPI#HPageresources ? In particular : /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName} HTTP Method: PUT * Accepted Media types: o application/xml (Page element) o text/plain (Only page content) o application/x-www-form-urlencoded (allowed field names: title, parent, content) Is something not clear about it ? Not working ? Thanks, Jerome Hi Jerome, Thanks for the reply. I was able to create the page afterwards. Sorry for the impatience :) However, today I am into different but similiar situation. I need to create users in XWiki through REST Api. Is it possible? How to do it? Thanks, Manish -- View this message in context: http://xwiki.475771.n2.nabble.com/How-to-add-a-page-with-contents-in-xwiki-through-Rest-api-tp4520594p5192646.html Sent from the XWiki- Users mailing list archive at Nabble.com. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] How to add a page with contents in xwiki through Rest api???
Nithya Vembu wrote: But i dont getting clear idea, how can i create a page under space with some contents.. and i am not getting any good samples for xwiki rest api. ... Kindly anyone give me idea how rest will get differentiate in xwiki manner.. Can anyone give me a code snippet for this requirement so that i can improve my progress in my project.. Any help greatly appreciated. Thanks in advance. Regards, Nithya. Hi, Did you happened to find the solution to your problem? If yes, would you please share it. Thanks, Manish -- View this message in context: http://xwiki.475771.n2.nabble.com/How-to-add-a-page-with-contents-in-xwiki-through-Rest-api-tp4520594p5188695.html Sent from the XWiki- Users mailing list archive at Nabble.com. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] XWiki Instalation
Maria Carolina Ramirez wrote: I supposed that all of this errors are happening because I have to install the *.xar files And then I got this error and that's all. I can't see nothing else. 16:48:03,158 INFO [STDOUT] Hibernate: select xwikidocum0_.XWD_ID as XWD1_0_0_, xwikidocum0_.XWD_FULLNAME as XWD2_0_0_, xwikidocum0_.XWD_NAME as XWD3_0_0_, xwikidocum0_.XWD_TITLE as XWD4_0_0_, xwikidocum0_.XWD_LANGUAGE as XWD5_0_0_, xwikidocum0_.XWD_DEFAULT_LANGUAGE as XWD6_0_0_, xwikidocum0_.XWD_TRANSLATION as XWD7_0_0_, xwikidocum0_.XWD_DATE as XWD8_0_0_, xwikidocum0_.XWD_CONTENT_UPDATE_DATE as XWD9_0_0_, xwikidocum0_.XWD_CREATION_DATE as XWD10_0_0_, xwikidocum0_.XWD_AUTHOR as XWD11_0_0_, xwik idocum0_.XWD_CONTENT_AUTHOR as XWD12_0_0_, xwikidocum0_.XWD_CREATOR as XWD13_0_0_, xwikidocum0_.XWD_WEB as XWD14_0_0_, xwikidocum0_.XWD_CONTENT as XWD15_0_0_, xwikidocum0_.XWD_VERSION as XWD16_0_0_, xwikidocum0_.XWD_CUSTOM_CLASS as XWD17_0_0_, xwikidocum0_.XWD_PARENT as XWD18_0_0_, xwikidocum0_.XWD_CLASS_XML as XWD19_0_0_, xwikidocum0_.XWD_ELEMENTS as XWD20_0_0_, xwikidocum0_.XWD_DEFAULT_TEMPLATE as XWD21_0_0_, xwikidocum0_.XWD_VALIDATION_SCRIPT as XWD22_0_0_, xwikidocum0_.XWD_COMMENT as XWD23_0 _0_, xwikidocum0_.XWD_MINOREDIT as XWD24_0_0_, xwikidocum0_.XWD_SYNTAX_ID as XWD25_0_0_, xwikidocum0_.XWD_HIDDEN as XWD26_0_0_ from xwikidoc xwikidocum0_ where xwikidocum0_.XWD_ID=? Hi, I know this is the older post. But do you remember how you solved this issue? I am facing the similiar issue now. Thanks, Manish -- View this message in context: http://xwiki.475771.n2.nabble.com/XWiki-Instalation-tp3736409p5150823.html Sent from the XWiki- Users mailing list archive at Nabble.com. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] How to list the subspace under the space?
I hadn't seen that. Thanks for sharing. -- View this message in context: http://xwiki.475771.n2.nabble.com/How-to-list-the-subspace-under-the-space-Little-bit-successful-need-more-steps-to-Go-tp5095367p5130817.html Sent from the XWiki- Users mailing list archive at Nabble.com. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users