HI Kabelo,

We typically do it from the command-line with curl.

First off, Make sure your CSV files are in the right format.
If your users will be using a username/password combination, prepare your CSV 
file as in [1]: username;password;lastName;firstName;email
If you will be using another authentication strategy (cas, google, …) you can 
simply omit the password column [2]: userId;lastName;firstName;email
The userId should be the userId that can be used with the external 
authentication service.

As far as the requests go:

Step 1: Get a session cookie by logging in as the global administrator on the 
global admin website (admin.oae.com by default)
ADMIN_COOKIE=$(curl -s -e "/" --cookie-jar - -d"username=administrator" 
-d"password=administrator" http://admin.oae.com/api/auth/login | grep 
connect.sess | cut -f 7)

Step 2: Upload the CSV file
In case you’ll by using the username/password strategy enter the following:
curl -F"file=@usersWithPasswords.csv" -F"tenantAlias=cam" 
-F"authenticationStrategy=local" --cookie connect.sess=${ADMIN_COOKIE} -e "/" 
http://admin.oae.com/api/user/import

In case you’ll be using an external authentication strategy such as cas
curl -F"file=@casUsers.csv" -F"tenantAlias=cam" -F”authenticationStrategy=cas" 
--cookie connect.sess=${ADMIN_COOKIE} -e "/" 
http://admin.oae.com/api/user/import

Kind regards,

Simon


[1] 
https://github.com/oaeproject/Hilary/blob/master/node_modules/oae-principals/tests/data/users-with-password.csv
[2] 
https://github.com/oaeproject/Hilary/blob/master/node_modules/oae-principals/tests/data/users-without-password.csv





On 27 Nov 2013, at 11:33, Kabelo Letsoalo <kab...@opencollab.co.za> wrote:

> Hi guys.
> 
> Going by the mailing list archive csv import function isn't available through 
> the UI yet. The exchange with Harry Wang didn't get into csv import of 
> external users.
> 
> Looked at rest.user.js and api.admin.js. What with the mutlipart form 
> necessary to do send request I can't do it with firebug and REST client 
> having authorization issues.
> 
> How do you guys do csv import?
> 
> Thanks a lot?
> 
> See OpenCollab email disclaimer at 
> http://www.opencollab.co.za/email-disclaimer_______________________________________________
> oae-dev mailing list
> oae-dev@collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/oae-dev

_______________________________________________
oae-dev mailing list
oae-dev@collab.sakaiproject.org
http://collab.sakaiproject.org/mailman/listinfo/oae-dev

Reply via email to