According to the RFC-6740 Specification, Section 1.1, a Resource Owner is defined as:
"An entity capable of granting access to a protected resource. When the resource owner is a person, it is referred to as an end-user."
In the case where ownership is not a person, but e.g. an organization unit, who is legit to perform the OAuth2 authorization? Only the account representing the unit, or also users associated to the unit?
To give an example:
- Let’s say there is a bookstore chain, with stores in Montreal, Lyon, Munich etc…
- Individual stores can update how many copies of a given book are available. This resource is owned by the organization unit (the Resource Owner) per specific location.
- So somewhere in the bookstore REST interface in our Resource Server there is a REST resource:
/bookstore/storelocations/{location}/{isbn}
- If the Lyon bookstore wants e.g. to update the amount of Harry Potter copies in store, they can do so by sending a [PUT] to
/bookstore/storelocations/Lyon/9780747532743
, with the updated amount in the HTTP body.
Let’s assume a new Client “StockReplenisher” enters the stage. It is a service that delivers book copies to locations. So now our Lyon organization unit wants to authorize StockReplenisher to change the amount of copies in the Lyon store, using OAuth2.
Question: Based on the Resource Owner definition, should the ownership of the /bookstore/storelocations/{location}/{isbn}
resource be considered...
- strictly individual, that is to say is it tied to a unique account representing the Lyon organization (and hence only this account can authorize the StockReplenisher Client).
- shared, that is to say indirectly owned by any employee of the Lyon organization (and hence there is no Lyon account in the system, but any employee is a Resource Owner and can authorize the StockReplenisher Client to access the Lyon resource.
(Let’s assume all employees are trusted, for simplicity)
I’m aware both can be implemented, my question is not about technical feasibility, but whether the second option is an OAuth2 anti-pattern (because of the non-individual resource ownership) or whether it is a perfectly valid OAuth2 scenario to assume multiple Resource Owners for a single resource endpoint.
Is there a part in the documentation / specification any other reference that provides clarity?
Note: the semantics of ResourceOwner has already been discussed with one of the RFC authors, but it seems not with respect to ownership being individual or not.
I've read the RFC specification, the Manning book OAuth2 in Action, and searched StackOverflow.