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

Clarify 401 vs. 403 #105

Merged
merged 1 commit into from Nov 17, 2015
Merged

Clarify 401 vs. 403 #105

merged 1 commit into from Nov 17, 2015

Conversation

michielbdejong
Copy link
Member

@ghost
Copy link

ghost commented Nov 6, 2015

Straight from the horse's mouth (RFC 6750):

   insufficient_scope
         The request requires higher privileges than provided by the
         access token.  The resource server SHOULD respond with the HTTP
         403 (Forbidden) status code and MAY include the "scope"
         attribute with the scope necessary to access the protected
         resource.

@michielbdejong
Copy link
Member Author

Thanks @fkooman, fixed in this PR (needs squashing of the two commits).

@untitaker
Copy link
Member

Same as #96?

On 6 November 2015 10:19:28 CET, Michiel de Jong notifications@github.com wrote:

See
https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#4xx_Client_Error
You can view, comment on, or merge this pull request online at:

#105

-- Commit Summary --

  • Clarify 401 vs. 403

-- File Changes --

M source.txt (5)

-- Patch Links --

https://github.com/remotestorage/spec/pull/105.patch
https://github.com/remotestorage/spec/pull/105.diff


Reply to this email directly or view it on GitHub:
#105

Sent from my phone. Please excuse my brevity.

* 403 for all requests that either have insufficient scope, e.g.
accessing a <module> for which no scope was obtained, or accessing
data outside the user's <storage_root>,
* 401 for all requests that don't have a valid bearer token,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For which definition of "valid" though? Should perhaps be something like "for all requests with missing, expired or revoked token".

@michielbdejong
Copy link
Member Author

Yes, but additionally it fixes https://github.com/remotestorage/spec/pull/96/files#r44145820 and removes the stray 'either' from the 403 text.

@michielbdejong
Copy link
Member Author

Updated with phrasing from irc (because public documents don't require a valid bearer token), and with reference to [OAUTH].

* 403 for all requests that either have insufficient scope, e.g.
accessing a <module> for which no scope was obtained, or accessing
data outside the user's <storage_root>,
* 401 for all requests that require a valid bearer token and
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still don't understand what "valid" is supposed to mean in this context. Syntactic validity might e.g. only mean that some value that fits the ABNF was sent. I couldn't find anything about valid tokens in the OAuth RFC.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was [BEARER], not [OAUTH], sorry (it's also already mentioned at the start of the section).

@ghost
Copy link

ghost commented Nov 17, 2015

+1

michielbdejong added a commit that referenced this pull request Nov 17, 2015
@michielbdejong michielbdejong merged commit a92cb8a into master Nov 17, 2015
@michielbdejong michielbdejong deleted the michielbdejong-patch-1 branch November 17, 2015 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants