Skip to Content.
Sympa Menu

grouper-users - [grouper-users] Re: Grouper and "Service accounts"

Subject: Grouper Users - Open Discussion List

List archive

[grouper-users] Re: Grouper and "Service accounts"


Chronological Thread 
  • From: "Hyzer, Chris" <>
  • To: "Black, Carey M." <>, "" <>
  • Subject: [grouper-users] Re: Grouper and "Service accounts"
  • Date: Wed, 28 Jun 2017 15:38:02 +0000
  • Accept-language: en-US
  • Authentication-results: osu.edu; dkim=none (message not signed) header.d=none;osu.edu; dmarc=none action=none header.from=isc.upenn.edu;
  • Ironport-phdr: 9a23:xXRLIhDQRVGBXUcFcLVxUyQJP3N1i/DPJgcQr6AfoPdwSP79pcbcNUDSrc9gkEXOFd2Crakb26yL6+jJYi8p39WoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6lX71zMZGw3+OAxpPay1X9eK14Xkn9y1rtf5ZwxDh371SrpoIQT+iEOb/p0chYJpKeBokEDhpWBVPela2DUsbRichRHh/sqquYN4/j5Lk/Mn68NaV6jmJeI1QaESRGApKWco/MDx8ATYQBGUznoaTmgMlBdUWU7I4AysDbnrtS6v/MpsyiSAeYXdTao1Qn7qu6JgSA76hT0vNiUytnzPh8p2yq9XvUTy9FRE34fIbdTNZ7JFdaTHcIZfHDIZUw==
  • Spamdiagnosticmetadata: NSPM
  • Spamdiagnosticoutput: 1:99

I added this to the GSH doc page:


https://spaces.internet2.edu/pages/viewpage.action?pageId=14517859



add a subject application principal with attributes (GSH)
String principal = "someApp";
String email = null;
 
GrouperSession grouperSession = GrouperSession.startRootSession();
 
 
addSubject(principal, "application", principal);
HibernateSession.bySqlStatic().executeSql("insert into subjectattribute (subjectId, name, value, searchValue) values (?, ?, ?, ?)", GrouperUtil.toListObject(new Object[]{principal, "description", principal, principal.toLowerCase()}));
if (email != null){ HibernateSession.bySqlStatic().executeSql("insert into subjectattribute (subjectId, name, value, searchValue) values (?, ?, ?, ?)", GrouperUtil.toListObject(new Object[]{principal, "email", email, email.toLowerCase()}));}
HibernateSession.bySqlStatic().executeSql("insert into subjectattribute (subjectId, name, value, searchValue) values (?, ?, ?, ?)", GrouperUtil.toListObject(new Object[]{principal, "loginid", principal, principal}));
HibernateSession.bySqlStatic().executeSql("insert into subjectattribute (subjectId, name, value, searchValue) values (?, ?, ?, ?)", GrouperUtil.toListObject(new Object[]{principal, "name", principal, principal}));
remove a subject with attributes (GSH)
String principal = "someApp";
String email = null;
 
GrouperSession grouperSession = GrouperSession.startRootSession();
 
HibernateSession.bySqlStatic().executeSql("delete from subjectattribute where subjectId = ?", GrouperUtil.toListObject(new Object[]{principal}));
HibernateSession.bySqlStatic().executeSql("delete from subject where subjectId = ?", GrouperUtil.toListObject(new Object[]{principal}));

thanks

Chris


From: <> on behalf of Black, Carey M. <>
Sent: Friday, May 26, 2017 1:06:02 PM
To:
Subject: [grouper-users] Grouper and "Service accounts"
 

All,

 

I have been trying to wrap my head around how Grouper deals with “local subjects”. Specifically for the use case of “Service Accounts”. Specifically for WebService clients to get data from Grouper.

                Note: I am not talking about how the authentication is done in this inquiry. Just how the “username”(AKA: Subject ID ?) is managed for this class of accounts.

                Note: I think I am getting wrapped around “old docs” and “old term in different contexts”…..

 

 

I think I have stumbled into a confusion on my part and I am hopful that someone can answer a few questions for me.

                REF: https://spaces.internet2.edu/display/Grouper/Grouper+local+entities

                REF: https://spaces.internet2.edu/pages/viewpage.action?pageId=14517859   ( GSH page)

 

 

I think there are two ways to make a “Local Subject” in grouper.

1)      Lite UI “Create or edit groups / roles / local entities”

a.       Which looks like the result from the gsh EntitySave()….. functions…

2)      gsh via the “addSubject” (function?)

 

 

However, these two paths appear to result in rather different things. (Thus my confusion.)

 

Option 1 appears to produce an object that is visible in Grouper( via the Grouper “new” UI ). However, it uses icons/language that implies that the thing that is created is a “Group” or some other type of object than a “person”.  ( The GSH output indicates this: type='application' )

                Example: I created a  Entity…

 

Entity testEntity = new EntitySave(rsess).assignCreateParentStemsIfNotExist(true).assignName("…:TEST-AGAIN").save();

findSubject("…:TEST-AGAIN");

subject: id='734731…..ee9b' type='application' source='grouperEntities' name='…:TEST-AGAIN'

 

 

Option 2 appears to produce an object that is NOT visible in Grouper( via the Grouper “new” UI ). However, it (the New UI) uses icons/language that implies that it is a “person”. (more like a “real subject from a Subject API”.)

                Example: I “addSubject”’ed a user called “WS-TESTING” and I get this back from GSH

                                findSubject("…:WS-TESTING");

                                id='…:WS-TESTING’ type='person' source='jdbc' name='WS-TESTING”

 

 

 

 

 

Personally I like the idea of the service accounts being a “first class citizen” (in the Grouper UI, AKA Option 1) but I am concerned that there is some subtle thing that I am not anticipating that will make me want to have gone the other way later. Due to the type value, or some other hang up down the road.

 

 

Can any one explain why one path would be better than the other?

Can any one explain why these two paths appear to be so different?

Can anyone explain how to remove an entry that was added with “addSubject”? (Since they are not “first class objects” in the Grouper UI I have not found the “delete/remove” gsh function/code yet. It is likely “obvious” but I am not seeing it.)

 

--

Carey Matthew

 



  • [grouper-users] Re: Grouper and "Service accounts", Hyzer, Chris, 06/28/2017

Archive powered by MHonArc 2.6.19.

Top of Page