If I understand well your use case.  REST may be not the best solution indeed
because you'll probably end up having problems adding the user to groups.  You
would create pages for each user but you should add them to the XWikiAllGroup
which leads to recreate the complete page each time (with all the users).

Anyway, if I understand well, you have somewhere a database with the list of
users.  However, you don't have some authentication system that you could use.
So the need is to synchronize you list of users from your own system to the
XWiki list of users.

One way I see is to have some Java code that runs each day/hour and check
the list of users on your database and if needed, create the missing users into
XWiki.  This way, you could use the XWiki API to create the users which will
allow a better control than XAR upload I think.  I have not a good idea on how
to do that but maybe the following link can help.
http://extensions.xwiki.org/xwiki/bin/view/Extension/Scheduler+Application

Hope I'm not completly out of subject and that it will help.
On Mon, Dec 22, 2014 at 03:04:39PM +0100, Thomas Mortagne wrote:
> I'm not 100% sure I understood your use case (or then I don't
> understand how you ended up manipulating XWiki REST API for this :))
> but if your need is to change the way XWiki authenticate you can write
> a custom authenticator, see
> http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Authentication#HCustomAuthentication.
> Usually this kind of authenticator connect to some service containing
> the reference users (and groups) and automatically create the current
> user as XWiki user, setup membership, etc.
> 
> On Mon, Dec 22, 2014 at 2:23 PM, li...@yhmail.de <li...@yhmail.de> wrote:
> > Hello!
> >
> > thank you for your answer. Maybe I should also tell you what the goal is. 
> > Maybe there is a better way to do this:
> >
> > We have created an Intranet-User Management. This way our department heads 
> > (or any other person having the necessary rights) can manage their users 
> > them self so the it-dep doesn't need to be involved. Typically the 
> > department head creates a new user and checks all services which should be 
> > available to the new user. Normally this would be "create user in AD", 
> > dispatch phone number and add user to sip-group, add SharePoint account.... 
> > and so on.
> >
> > For various reasons we do not have a SSO solution and therefore cannot 
> > simple connect all services. So in order to simulate something like a SSO 
> > we want our users to authenticate against our intranet site and then they 
> > can decide where to go next. Normally we then just load the service into an 
> > iFrame and pass along the authentication needed.
> >
> > We would like to add xwiki to this services. Therefore we need to be able 
> > to create accounts and assign user-rights to them.
> >
> > The application behind all this is mostly written in Java and JavaScript. 
> > We don't send any files except the Json part. And yes we need to 
> > authenticate given a username and a password.
> >
> > If there are any other possible solutions for this scenario I would be more 
> > then happy to look into them.
> >
> > Thanks,
> > Chris
> >
> >
> > ________________________________________
> > From: users <users-boun...@xwiki.org> on behalf of Jean SIMARD 
> > <jean.sim...@xwiki.com>
> > Sent: Monday, December 22, 2014 10:55 AM
> > To: XWiki Users
> > Subject: Re: [xwiki-users] Manipulate users and groups via REST-API
> >
> > Hi Chris,
> >
> > I've already played with the REST API to upload XAR, never to manipulate 
> > list of
> > users.  It worked pretty well for my simple use but indeed, it took me a 
> > bit of
> > time to figure out how it work.
> >
> > Maybe you could answer the following answers if you want a bit of help:
> > - What tool are you using to send your REST request (from Java, cURL, 
> > other)?
> > - What it looks like (the code, the cURL command)?
> > - What are the files you send with if there is any?
> > - Do you send authentication credentials in the request?
> >
> > Hope this helps.
> > On Sun, Dec 21, 2014 at 05:43:32PM +0000, li...@yhmail.de wrote:
> >>
> >> Hello everyone,
> >>
> >> I need to manipulate user and groups (create/delete) via the REST-API. Has 
> >> anyone done this before? Maybe he/she is willing to share their scripts?
> >>
> >> I appreciate any help. So if anyone can point me in the right direction 
> >> this would be great.
> >>
> >> I started here:
> >>
> >>  
> >> http://platform.xwiki.org/xwiki/bin/view/Features/XWikiRESTfulAPI#HXWikiRESTfulAPIDocumentation
> >>
> >> But I always get the result:
> >>
> >>
> >> The server has not found anything matching the request URI.
> >>
> >> Thank you for your help,
> >> Chris
> >> _______________________________________________
> >> users mailing list
> >> users@xwiki.org
> >> http://lists.xwiki.org/mailman/listinfo/users
> >
> > --
> > Jean Simard
> > jean.sim...@xwiki.com
> > Research engineer at XWiki SAS
> > http://www.xwiki.com
> > Committer on the XWiki.org project
> > http://www.xwiki.org
> > _______________________________________________
> > users mailing list
> > users@xwiki.org
> > http://lists.xwiki.org/mailman/listinfo/users
> > _______________________________________________
> > users mailing list
> > users@xwiki.org
> > http://lists.xwiki.org/mailman/listinfo/users
> 
> 
> 
> -- 
> Thomas Mortagne
> _______________________________________________
> users mailing list
> users@xwiki.org
> http://lists.xwiki.org/mailman/listinfo/users

-- 
Jean Simard
jean.sim...@xwiki.com
Research engineer at XWiki SAS
http://www.xwiki.com
Committer on the XWiki.org project
http://www.xwiki.org
_______________________________________________
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to