{"id":483,"date":"2008-06-04T19:52:49","date_gmt":"2008-06-04T23:52:49","guid":{"rendered":"http:\/\/www.dr-chuck.com\/wordpress\/?p=483"},"modified":"2011-12-17T12:26:29","modified_gmt":"2011-12-17T16:26:29","slug":"stepping-into-multi-tenancy-users-for-sakai-sak-13671","status":"publish","type":"post","link":"https:\/\/www.dr-chuck.com\/csev-blog\/2008\/06\/stepping-into-multi-tenancy-users-for-sakai-sak-13671\/","title":{"rendered":"Stepping into Multi-Tenancy Users for Sakai &#8211; SAK-13671"},"content":{"rendered":"<p>This is a set of proposed changes to a very core API &#8211; UserDirectory services &#8211; so I would like folks to take a look and comment before work gets started.  Take a look at the JIRA for more detail:<br \/>\nhttp:\/\/bugs.sakaiproject.org\/jira\/browse\/SAK-13671<br \/>\nThe basic idea is to make it so we can have enterprise IDs from multiple sources &#8211; probably the best use case is if you wanted to build a friend-like capability using perhaps Radius and OpenID to compliment your local accounts perhaps coming from a campus LDAP\/Kerberos or something.  You want to be able to tolerate an account &#8220;csev&#8221; from any of the three sources &#8211; i.e. you don&#8217;t want it to be a security hole if the local csev account is a teacher for a course and an account named &#8220;csev&#8221; shows up from an OpenID or Radius Source &#8211; and all of a sudden they are teaching all my courses.<br \/>\nSince Sakai has an internal random ID for all users in places like Realm tables, etc &#8211; the is a pretty surgical change in terms of data structure.  We only record the Enterprise ID (eid) in one table:  SAKAI_USER_ID_MAP &#8211; I propose to add an ESOURCE column to this table.  The EID\/ESOURCE combination is the unique key now for the table.<br \/>\nWe leave the column NULL for all accounts on the system and all the current calls to mae new users leave the column NULL &#8211; so unless you start adding these users from another Enterprise, nothing changes.<br \/>\nIf on the other hand, you come up with some new approach to login &#8211; such as Shibboleth or a Radius login &#8211; and this login process starts making new users with different ESOURCE values &#8211; then these accounts with non-NULL ESOURCE values do not collide with the normal internal and default enterprise users.  The accounts &#8220;pass in the night&#8221; from an AuthZ, etc perspective.<br \/>\nThe Changes to UserDirectoryService are pretty simple &#8211; anywhere there is an Enterprise ID &#8211; we add a new method with one more optional parameter &#8211; the Enterprise Source &#8211; sourceId &#8211; so the methods look like this:<br \/>\nOld:<br \/>\naddUser(String id, String eid)<br \/>\nNew:<br \/>\naddUser(String id, String eid, String sourceId)<br \/>\nOld:<br \/>\nauthenticate(String loginId, String password)<br \/>\nAdded:<br \/>\nauthenticate(String loginId, String sourceId, String password)<br \/>\nWe keep the old methods &#8211; they are the same as calling the new methods with a sourceId of NULL.<br \/>\nThere is more detail in the JIRA http:\/\/bugs.sakaiproject.org\/jira\/browse\/SAK-13671<br \/>\nFeel free to add comments there.  Since this touches a pretty core API &#8211; I want to make sure that it is well discussed before starting the branch.  Assuming we like the general approach &#8211; then it can be coded up in a branch and folks will get many more opportunities to review it in detail and comment.  I just wanted to get the dialog started early.<br \/>\nI have no current plans in this JIRA to change the provider API &#8211; for now we can use the providers for the &#8220;default&#8221; enterprise so nothing needs to change.  At some point we might want multiple providers &#8211; one for each enterprise source &#8211; or perhaps just pass in the enterprise source as a parameter.  You are welcome to think this through &#8211; I would like to do that as a separate JIRA.<br \/>\nThe folks who find this the most useful are those who might want to use Sakai as a platform for software as a service.<br \/>\nIf you can think of risks  and\/or issues &#8211; please bring them up on the dev list or in the JIRA.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a set of proposed changes to a very core API &#8211; UserDirectory services &#8211; so I would like folks to take a look and comment before work gets started. Take a look at the JIRA for more detail: http:\/\/bugs.sakaiproject.org\/jira\/browse\/SAK-13671 The basic idea is to make it so we can have enterprise IDs from [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-483","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts\/483","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/comments?post=483"}],"version-history":[{"count":1,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts\/483\/revisions"}],"predecessor-version":[{"id":2590,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts\/483\/revisions\/2590"}],"wp:attachment":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/media?parent=483"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/categories?post=483"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/tags?post=483"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}