I have to admit you guys have now gone beyond my ability to follow. :-) If someone could summarize in English pseudo-spec language, and a simple example, I would be very very grateful. I would like any discussion of this tomorrow to to be efficient, because there's lots of other stuff to discuss too.


Eve Maler
Cell +1 425.345.6756 | Skype: xmlgrrl | Twitter: @xmlgrrl


On Tue, Jan 10, 2017 at 2:02 PM, James Phillpotts <james.phillpotts@forgerock.com> wrote:
Well, in fact I was suggesting:

Requested = union(intersection(ClientReg, ClientReq), RSTicket, ClientRegisteredDefaults)

But I can live with ClientRegisteredDefaults being an off-spec AS extension, so yes :)

Cheers
James

On 10 January 2017 at 19:16, George Fletcher <george.fletcher@teamaol.com> wrote:
Yes, though I'd feel better with James weighing in to make sure I understood his idea correctly:)

On Tue, Jan 10, 2017 at 2:08 PM Justin Richer <jricher@mit.edu> wrote:
Interesting thought — so are you suggesting that:

Requested = union(intersection(ClientReg, ClientReq), RSTicket)

That would let ClientReg be a limiting set but wouldn’t leave out the RS requesting more scopes (or policies granting more scopes) than the client itself asked for.

I could live with that interpretation.

 — Justin

On Jan 10, 2017, at 12:01 PM, George Fletcher <george.fletcher@teamaol.com> wrote:

I personally don't have any issues making the client be explicit about it's requests, so I'd prefer to not have a default option at all and just have the client request what it wants at each RPT/Token request. This would then cause the ClientReg set to just be a limiting set on what the client can request at run time. 

Note that the AS is free to not allow all the scopes requested in the ClientReg set at registration time, in which case the limiting set gets smaller. If that happens, then the only way the client can get a particular scope needed to access a resource is if that scope is identified by the permission ticket.

On Tue, Jan 10, 2017 at 11:57 AM James Phillpotts <james.phillpotts@forgerock.com> wrote:
Yes, exactly. The RS's permission ticket-requested scope values are incontrovertible. The registered scopes should only apply to whatever the Client is trying to request on top of that.

So my proposal is that the scope value in the client registration should be a restriction for what it can request in that vein (as RFC 7591 specifies it). A separate field, default_scope, could be added for what might get added by default. So I guess I'm suggesting a sort of hybrid of Option 2 and Option 3 from the minutes from last week's meeting.

Cheers
James
On 10 January 2017 at 16:32, George Fletcher <george.fletcher@teamaol.com> wrote:
So how do you want to apply the "superset" thinking to the scopes requested by the client at registration time? Are you thinking that the client can only explicitly requests scopes that are within that set? even though the permission ticket my expand the set beyond that?

Thanks,
George


On Tue, Jan 10, 2017 at 11:23 AM James Phillpotts <james.phillpotts@forgerock.com> wrote:
Like I said, I'm talking about scope values requested by the client, not by the RS in the permission ticket.

J.
On 10 January 2017 at 16:21, George Fletcher <george.fletcher@teamaol.com> wrote:
Hi James,

I guess what I'm saying is that even if the client registers for scopes A, B, C, and F; that doesn't prohibit the client from in fact requesting for scope K (as identified by the RS as required for the requested resource) when requesting a new RPT.

So in that sense, the list of client registered scopes can not be considered the super set of all scopes the client can request (which is what I thought you were saying in your email; again I probably misunderstood your intent:)

Thanks,
George
On Tue, Jan 10, 2017 at 10:45 AM James Phillpotts <james.phillpotts@forgerock.com> wrote:
Hi George,

I'm not sure I understand you - we're talking here about scope values that the client knows about itself, registers for, and can be requested separately from those that are in the permission ticket. As such, a degree of static-ness can be assumed, in the same way as it is in vanilla OAuth.

Cheers
James
On 9 January 2017 at 22:51, George Fletcher <george.fletcher@teamaol.com> wrote:
Hi James,

I may have misunderstood, but I don't think with UMA there is anyway to say a client can only ask for scopes within this "set". (referencing your last paragraph).

Because of the dynamic nature of scopes and permissions tickets, a key capability of a client within UMA is the ability to get access to a resource that requires a scope the client has never even "seen" before. The key to be able to get authorized for this new scope is the ability to mean the ROPolicy for the requested resource. If the client/RqP can meet the required policy, then the RPT is granted the associated scope(s).

I can envision an AS defining a "black list" of scopes that a particular client could NEVER be authorized for, but this seems AS specific and out of scope for UMA.

Thanks,
George


On Mon, Jan 9, 2017 at 4:06 AM James Phillpotts <james.phillpotts@forgerock.com> wrote:
This seems well thought out, thanks Justin. I've got just one concern:

I'm uneasy about using the client registered scopes as 'default scopes' in the case of UMA, when RFC7591 states that registered scopes represent "scope values that the client can use when requesting access tokens" - as you stated in Thursday's call. I'm particularly concerned about how any of this plays out when the client is trying to be both a vanilla OAuth (or OpenID Connect) client as well as an UMA client. If the client registers for scopes "openid profile view edit", then they must explicitly request openid and profile scope values in the token request in order to get an access token that contains those scopes, but if they present a permission ticket as well, we're saying they view and edit will automatically get evaluated/added without the client knowing about it.

I would prefer that we submit an extra 'default_scope' attribute to the OAuth Dynamic Client Registration Metadata Registry (https://tools.ietf.org/html/rfc7591#section-4) to disambiguate from the existing 'scope' field. The client could then register with scope "openid profile edit" and default_scope of "view".

This also has an extra advantage of being able to use the registered scope field to block requests for scope values that have not been registered for the client - i.e. client registers for scope A, has a permission ticket for scope B, but requests scope C in the token request, which should then result in an 'invalid_scope' response.

Cheers
James
On 8 January 2017 at 21:05, Justin Richer <jricher@mit.edu> wrote:
Per the first point: But the AS still has to deal with its own internal processing of "which scopes the RO said were OK if the RqP did certain things good enough" which might not be the same set of scopes requested. This is effectively the set of scopes that result from processing the set of claims supplied by the RqP and client. We *have* to include this in the calculation even though the details of how that's specified by the RO or how the processing engine translates claims to scopes is out of band for us since the *results* of that calculation are bound to show up somehow. And it remains to me to be a clearly limiting set.

Per the second point: It's a separate question whether to reissue the old RPT or reuse its value. No matter what happens there, the question is: what do we do with the scopes associated with the *input* RPT if present? I say we *allow* the AS to add them to the resulting RPT (whether it's now or reissued or whatever, we don't care) but don't *require* the AS to do that. So my pseudocode below is valid but not strictly required as a template for implementors.

Per the third point: the scopes here are nearly all already associated with a resource, apart from ClientReg which tends to be generic in implementations I've seen to date. Namely:
RSTicket - ticket is associated with a specific resource set ID on ticket request
ROPolicy - policy is associated with a specific resource set ID on creation at AS
ClientReq - these are submitted along with a ticket which is associated with a specific resource set ID
RSReg - these are associated with a specific resource set by tautological definition :)

This leaves us two:
        ClientReg - these would tend to be generic, crossing resource sets (likely pertaining to a specific kind of API the client knows how to deal with and not an instance of the same)
        PrevRPT - these might cross a bunch of different resource sets, but at this point the internal permissions structure might be such that they're associated with the token in a way that doesn't overlap the new ones.

To wit, a token starts with:

    rsid_1: { foo, bar }, rsid_2: { baz, qux }

And a new request in the context of rsid_3 adds in { foo, batman } and we end up with:

    rsid_1: { foo, bar }, rsid_2: { baz, qux }, rsid_3: { foo, batman }

That's pretty clearly new stuff. The real trick comes when you get a new request with that first token in the context of rsid_1 again with { foo, batman } being requested/approved. This is the "token step up" function that's been in UMA since forever, and I argue that this *could* come out with a token looking like:

    rsid_1: { foo, bar, batman }, rsid_2: { baz, qux }

Or it *could* come out with a token that looks like:

    rsid_1: { foo, batman }

And it's up to the AS to figure out which it wants to do. Again, note: Whether this permissions set is associated with the same token value string as the input RPT is subject to the logic in your message repeated below, and that's a separate question entirely and ought to be decided orthogonally.

 -- Justin


On 1/8/2017 1:51 AM, Eve Maler wrote:
Humongously useful, thank you! Comments on three parts:

====

Policy conditions are out of scope for UMA, so the AS could be configured with all kinds of stuff that is out of scope for what UMA cares about, but since "the AS only knows what the RS told it" as far as UMA goes, RSReg definitely counts as a reasonable limiting factor in my book.

====

Regarding the question of whether the AS honors previous RPTs (K, L): I suspect this is a bit more complex, partially because any RPT could cover more than one resource already, so L is a possibility at any time. The "previous RPT" case would happen when the client chooses to bring a failed RPT to the token endpoint and asks for an RPT that won't fail. The AS has a choice too (as I put it in a recent message):
  1. (Client can bring no RPT and ask for one -- not a concern)
    1. (AS can issue a new RPT A -- not a concern)
  2. Client can bring RPT A that doesn't have a permission for what it wants to do and ask for an RPT that works for what it wants to do
    1. AS is allowed to reissue the existing RPT A (same RPT string), having added the relevant permissions to it
    2. AS can issue a new RPT B (different RPT string), having added the relevant permissions to it
      1. AS can invalidate the old RPT A that the client brought it upon this action
      2. AS can retain the validity of the old RPT A that the client brought it and any of its permission(s) -- presumably ones that are still good and that the client didn't just try to exercise but found wanting
(Justin, you suggested that if the AS issues a new token, we say "the AS SHOULD revoke the existing RPT, if possible" and "the client MUST discard its previous RPT" on the reasoning that this matches OAuth refresh token guidance, which I like.)

You can see I was presuming that reissuing an existing RPT would upgrade that token. If it contained totally orthogonal resources and scopes relative to the current request, it could still be upgraded with a relevant resource and scope.

Is it also possible that the AS's TTL strategy and/or the RO's other changes in policy might also dictate "cleaning house", so to speak, and downgrading other permissions while it's upgrading the permission of interest? Or is this not fair game?

====

Regarding the pièce de résistance (French, meaning "piece of resistance"), the pseudocode, it seems to be pretty complete and logical, and I like that it preserves George's rationale of client registration as a round-trip-saving exercise. The only thing I can't find in it (and this whole discussion, really) is some statement of how scopes match to resources, given that identical scopes may appear on multiple resources. I'm hoping that doesn't have to have to be so much a complication as a matching strategy.



Eve Maler
Cell +1 425.345.6756 | Skype: xmlgrrl | Twitter: @xmlgrrl


On Fri, Jan 6, 2017 at 2:56 PM, Justin Richer <jricher@mit.edu> wrote:
I’ve been working on the set math problem and I’ve been trying to lay out scenarios using this spreadsheet to help me sort my thoughts:

<Mail Attachment.png>

I’ve left a bit of space in the spreadsheet for additional combinations and use cases I might have missed, so please chime in and we can figure out an algorithm that we can all agree on. I can send out the .xlsx file if people care to play with it at home.

So we’ve got six sets of scopes to deal with here, and they’re somewhat independent of each other. 

ClientReg - client registers for these scopes at the RS
RSTicket - RS requests a ticket with these scopes
ROPolicy - RO sets a policy with these scopes (and it’s fulfilled by the RqP for our purposes)
ClientReq - client requests these scopes at the token endpoint
RSReg - RS registers these scopes at RS setup time
PrevRPT - client presents a previously-held RPT that’s got some other scopes on it and it’s trying to augment that with new scopes

And finally what the token includes:

RPTResult - the sets that the resulting token includes on output

The one direct relationship seems to be that:

ROPolicy = subset(RSReg)

Because otherwise the RO could set scopes on a resource that the resource didn’t register, which doesn’t make sense to me. That’s the error in column “F” above. 

It’s clear to me that “ROPolicy” is a limiting set, in that if a scope is NOT in that set, then it is not in the result. In other words:

RPTResult = subset(ROPolicy)

That’s column D, and nearly any other combination without ROPolicy doesn’t let the scope go through, with one exception: if it’s in PrevRPT, it gets carried through no matter what. But in particular, that, I believe, is an AS decision on whether it wants to honor previous RPTs at all. That’s why I’ve coded those K, L in green.

This also means that RSReg is also a limiting set, due to transitive subset operations:

RPTResult = subset(RSReg)
--
Distinguished Engineer
Identity Services Engineering, AOL Inc.


_______________________________________________
WG-UMA mailing list
WG-UMA@kantarainitiative.org
http://kantarainitiative.org/mailman/listinfo/wg-uma