<div dir="ltr">Hi Josh-- Below...<div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr">







<p><b>Eve Maler<br></b>ForgeRock Office of the CTO | VP Innovation & Emerging Technology<br>Cell +1 425.345.6756 | Skype: xmlgrrl | Twitter: @xmlgrrl<br>Join our <a href="http://forgerock.org/openuma/" target="_blank">ForgeRock.org OpenUMA</a> community!</p></div></div></div></div></div>
<br><div class="gmail_quote">On Mon, Jun 15, 2015 at 2:24 PM, Josh Mandel <span dir="ltr"><<a href="mailto:Joshua.Mandel@childrens.harvard.edu" target="_blank">Joshua.Mandel@childrens.harvard.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra">Hi all,</div><div class="gmail_extra"><br></div><div class="gmail_extra">I didn't mean to take a hard-line position on today's call about scope definitions! To my mind, our approach to scopes will need to work hand-in-hand with our approach to endpoint (or resource set) discovery -- so I feel a bit awkward discussing scopes here in isolation. But that said, let me see if I can at least highlight the tension that we heard in the past hour's discussion (in a neutral way):</div><div class="gmail_extra"><br></div><div class="gmail_extra">---</div><div class="gmail_extra"><i>Goal: Whatever the model, we want to support a use case where Alice signs into her resource server and can set some policies in an intuitive way. |She'd see something like (very, very roughly):</i></div><div class="gmail_extra"><br></div><div class="gmail_extra"> My Medications: </div><div class="gmail_extra"> * Who can view?</div><div class="gmail_extra"> * Who can write new prescriptions?</div><div class="gmail_extra"><br></div><div class="gmail_extra">My Step Counts</div><div class="gmail_extra"> * Who can view?</div><div class="gmail_extra"> * Who can remove?</div><div class="gmail_extra">---</div><div class="gmail_extra"><br></div><div class="gmail_extra">The question is about how this works under the hood.  I think we were discussing two models:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><b>Model 1: The "UMA-First" approach</b></div><div class="gmail_extra"><i>We have a resource set like "Alice's Medications", with scopes like "view" and "prescribe". And we'd have a resource set like "Alice's Step Counts" with scopes like "view" and "delete".</i></div><div class="gmail_extra"><br></div><div class="gmail_extra"><b>Model 2: The "OAuth-First" approach</b></div><div class="gmail_extra"><i>We have a resource set like "Alice's FHIR Endpoint", with scopes like "Medications.view", "Medications.prescribe", "Steps.view", and "Steps.delete".</i></div><div class="gmail_extra"><div class="gmail_extra"><br></div></div></div></blockquote><div><br></div><div>Talking about an "OAuth-first" approach for setting policies is making me confused. I know what it looks like to enable OAuth-like flows in UMA when Alice is both the requesting party and the owner of the resource. And I know what it looks like to enable Alice to set policies at an UMA authorization server (which might hold the results of a previous OAuth-like flow done in UMA). But I don't know what "setting policies in OAuth" means because the OAuth experience is about consenting at run time (possibly checking and unchecking individual scopes), and revoking tokens at the AS/RS.</div><div><br></div><div>So the closest UX analog would probably be the wording displayed in an OAuth consent dialog, maybe something like:</div><div><ul><li>View [and prescribe] your medications</li><li>View [and delete] your steps</li></ul></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_extra"></div><div class="gmail_extra">If the *types* of Resource Sets and the allowed scopes are standardized in advance (which UMA supports), then a mapping between Model 1 and "vanilla" OAuth could be as simple as: "concatenate the UMA resource set type followed by ':' followed by the UMA scope name" -- so for example, you might derive an OAuth scope like "<a href="https://openid.net/heart/resource-types/StepCounts:https://openid.net/heart/scopes/view" target="_blank">https://openid.net/heart/resource-types/StepCounts:https://openid.net/heart/scopes/view</a>". Or under Model 2, the scopes could be reused directly (no mapping required). </div></div></div></blockquote><div><br></div><div>In what sense is "reuse" meant here? A coding model, or an architectural model, or a semantic model?... There are ways in which I could imagine a deep kind of semantic reuse being possible without concatenation tricks being necessary. However, not being a developer, I'm not sure if they match what you're thinking of.</div><div><br></div><div>For example, in my previous response to the minutes email, I outlined how some APIs have implicit mappings between scopes and acceptable endpoints/resources to which they apply.</div><div><br></div><div>Let's say (totally making this up) the FHIR has two endpoints, with one endpoint for medication records and one for fitness steps. There's an UMA-standardized resource type for each. There's "<b><a href="https://www.hl7.org/fhir/rsrc/med.json">https://www.hl7.org/fhir/rsrc/med.json</a></b>", with instances of it registered with scopes "<b>view</b>", "<b>download</b>", "<b>transmit</b>", and "<b>add</b>" (so some clients can insert new entries). Alice's medications might be in a resource something like "<b>/alice/meds</b>". (What's displayed in her AS dashboard might look a lot nicer than that.) And there's "<b><a href="https://www.hl7.org/fhir/rsrc/step.json">https://www.hl7.org/fhir/rsrc/step.json</a></b>", with instances of it registered with scopes "<b>view</b>", "<b>download</b>", "<b>transmit</b>", and "<b>chart</b>". Alice's steps might be in a resource like "/alice/steps".</div><div><br></div><div>(If the scopes are in the form of URIs, they could be standardized to a further degree, in that a bunch of metadata could be pulled by the authorization server and used to present standard labels and icons, and other semantics could be linked to them.)</div><div><br></div><div>If the very same API were OAuth-protected, with the very same resource endpoints, there might still be the same resource endpoints, with the same scopes, where three of them work on both resource types, "<b>add</b>" only works on "<b>med</b>", and "<b>chart</b>" only works on "<b>step</b>". These resources could still have a standardized meaning in terms of both resource naming and schema/format; there just would be nowhere to "hook" a standardized resource type URI into.</div><div><br></div><div>Seen this way, the OAuth approach and the UMA approach are quite similar, differing only in the implicitness vs. explicitness of the resource set layer.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><br></div><div class="gmail_extra">Of course, some interesting things happen when we layer in details like...</div><div class="gmail_extra"><br></div><div class="gmail_extra">W<i>hat if Alice has access to <b>multiple records </b>(say, her own and her mother's)?</i> In vanilla OAuth the binding of permissions to these records is generally implicit. How should they play out in UMA? Under Model 1, we'd probably see two more Resource Sets created ("Alice's Mom's Medications" and "Alice's Mom's Steps"). Under Model 2, we'd probably see one more Resource Set created ("Alice's Mom's FHIR Endpoint").</div></div></blockquote><div><br></div><div>I've been doing some work around chained delegation of this sort. Indeed, these are separate records, and must remain that way. Alice may not have all the permissions over her mother's records that she has over her own! One way to present such "downstream" items is to present them under a separate "Shared With" area. And there are various ways to organize owned items, e.g. by who you tend to share them with or by function. In discussions with consumer IoT folks, it seems that smart light bulbs want to be gathered by "room".</div><div><br></div><div>FWIW...</div></div></div></div>