Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Query] Best approach to handle authorization_details and scope conflicts #101

Open
VimukthiRajapaksha opened this issue Dec 21, 2023 · 2 comments

Comments

@VimukthiRajapaksha
Copy link

Hi,

The "Relationship to the 'scope' Parameter" section[1] says both authorization_details and scope can be used in the same authorization request. We're unsure what happens when there's a conflict between them in the same request. For example, imagine a scenario where an authorization request has both the READ_ACCOUNTS scope and the following authorization_details JSON.

[
  {
    "type": "account_information",
    "actions": [
      "WRITE_ACCOUNTS"
    ],
    "locations": [
      "https://example.com/accounts"
    ]
  }
]
curl https://www.auth-server.com/authorize? \
	response_type=code& \
	client_id=<client_id>& \
	redirect_uri=https://www.example.com/callback& \
	scope=READ_ACCOUNTS& \
	authorization_details=[{"type":"account_information","actions":["WRITE_ACCOUNTS"],"locations":["https://example.com/accounts"]}]

When the scope and authorization_details conflict, does one take precedence? Or, if it's different for each API, may we know what is the best practice suggested by the specification?

[1] https://datatracker.ietf.org/doc/html/rfc9396#name-relationship-to-the-scope-p

Thanks,
Vimukthi

@tlodderstedt
Copy link
Collaborator

tlodderstedt commented Dec 21, 2023 via email

@jricher
Copy link
Collaborator

jricher commented Dec 21, 2023

It is definitely per-API to determine the precedence, just like with plain scope values on their own -- if I ask for "write" vs "read write" is that the same, or different? It depends on the API, really - you could have an API with a write-only option so they'd be different, or you could have write subsume the read operation. The same logic applies here with RAR.

One approach is to define each existing scope value as expanding to a specific RAR object structure, and then define how the different RAR structures compare to each other.
A sensible interpretation of your specific example would be READ_ACCOUNTS with no other details means it applies across all possible accounts but WRITE_ACCOUNTS at that specific location (and not others). But if, for example, there's only one applicable location, this wouldn't really be different, and you'd have to decide whether the write subsumes the read or they add to each other.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants