Include Page | ||||
---|---|---|---|---|
|
This page is instructions on how to get going with Grouper quickly, as an example from Penn. There are other quick starts for Grouper, this is another one.
...
- Unzip or checkout grouper api
- e.g. for the 1.4 branch
git clone https://github.com/Internet2/grouper.git
git checkout --track origin/GROUPER_1_4_BRANCH
- e.g. for the 1.4 branch
- Run: ant dist
- Hsql doesnt work too well, so switch to mysql. Create a schema and user in mysql (e.g. grouperuser@localhost). I recommend the free version of sqlyog to manage mysql.
Change these settings in conf/grouper.hibernate.properties
Code Block hibernate.dialect = org.hibernate.dialect.MySQL5Dialect hibernate.connection.driver_class = com.mysql.jdbc.Driver hibernate.connection.url = jdbc:mysql://localhost:3306/grouper?useSSL=false hibernate.connection.username = grouper hibernate.connection.password = whateverYouSet
- Copy the grouper_home/lib/jdbcSamples/mysql-connector-java-bin.jar to grouper_home/lib/custom
- Add tables: bin\gsh -registry -runscript
- If there is an error, check the logs carefully, check the db, to be sure it failed. If a lot of views are there, things might be ok. If grouper_fields is empty, run: bin\gsh -registry -reset
- You should now be able to browse the DB with sqlYog or whatever tool you use to admin the db
- Check tables: bin\gsh -registry -check
- Should output: NOTE: database table/object structure (ddl) is up to date
- Start gsh and add a subject: bin\gsh
- gsh 0% addSubject("mchyzer", "person", "Chris Hyzer")
gsh 1% exit
- gsh 0% addSubject("mchyzer", "person", "Chris Hyzer")
In grouper.properties, I will change/add these settings:
Code Block groups.wheel.use = true groups.wheel.group = etc:sysadmingroup configuration.autocreate.group.name.0 = etc:sysadmingroup configuration.autocreate.group.description.0 = super users configuration.autocreate.group.subjects.0 = mchyzer configuration.autocreate.group.name.1 = etc:webServiceUsers configuration.autocreate.group.description.1 = users allowed to log in to the WS configuration.autocreate.group.subjects.1 = mchyzer configuration.autocreate.group.name.2 = etc:webServiceActAsUsers configuration.autocreate.group.description.2 = users allowed to act as other in the WS configuration.autocreate.group.subjects.2 = mchyzer
- Start gsh again: bin\gsh see if the user is in the groups
- gsh 0% grouperSession = GrouperSession.startRootSession();
edu.internet2.middleware.grouper.GrouperSession: f802d876-b876-4315-b76e-0586bcc561b1,'GrouperSystem','application'
gsh 1% subject = findSubject("mchyzer");
subject: id='mchyzer' type='person' source='jdbc' name='Chris Hyzer'
gsh 2% member = MemberFinder.findBySubject(grouperSession, subject);
member: id='mchyzer' type='person' source='jdbc' uuid='1324c75e-9435-4c45-97e9-af40f2b71046'
gsh 3% member.getGroups();
group: name='etc:sysadmingroup' displayName='etc:sysadmingroup' uuid='38990f70-3d93-4a80-933c-6358c524024c'
group: name='etc:wsActAsUsers' displayName='etc:webServiceActAsUsers' uuid='e87171ed-69e4-4cf8-91ea-c463770b71b1'
group: name='etc:wsUsers' displayName='etc:webServiceUsers' uuid='6b2928d8-08f7-4cab-91f0-cb42dc794456'
group: name='etc:uiUsers' displayName='etc:userInterfaceUsers' uuid='4103ede1-fdd1-419b-a5a7-0d2a6b3220eb'
gsh 4%
- gsh 0% grouperSession = GrouperSession.startRootSession();
- If you want quickstart data, download this file into quickstart.xml, and this file into subjects.sql. (note, you need to act as admin, or adjust permissions to see this data, but you can verify in the DB that there a lot of groups/stems/etc)
- Import with: bin\gsh -registry -runsqlfile subjects.sql
- Import with: bin\gsh -xmlimport GrouperSystem quickstart.xml
...