hypothesis / hypothesis/h

Fix OAuth explanation in documentation

Open Beginner friendly
#5,695 0 comments 0 reactions 0 assignees View on GitHub
API code health
Dominant language
Python
Stars
3.2k
Forks
459
Avg merge
27d 1h
Merged PRs (30d)
1

Description

This is from feedback from Ghotit, found in ZD here: https://hypothesis.zendesk.com/agent/tickets/5816

https://h.readthedocs.io/en/latest/api/using-oauth/#implementing-oauth-flow
In paragraph 2:
------------------------------------------------------
After the user authorizes the application, it will receive an authorization code via a call to the redirect URI. The application must exchange this code for an access token by making a request to the POST /api/token endpoint as described in 4.1.3 Access Token Request.

POST /api/token HTTP/1.1
Content-Type: application/x-www-form-urlencoded

client_id=631206c8-7792-11e7-90b3-872e79925778&code=V1bjcvKDivRUc6Sg1jhEc8ckDwyLNG&grant_type=authorization_code
---------------------------------------------------------

However, according to the RFC, if the first request (4.1.1 Authorization Request.) contains redirection URL, the second request as a MUST to contain the same redirection URL

To conclude:
Add to the above example the redirection URL, namely:
redirect_uri=https%3A%2F%2Fmyapp.com%2Fauthorize&

Finally, it should be:
client_id=631206c8-7792-11e7-90b3-872e79925778&code=V1bjcvKDivRUc6Sg1jhEc8ckDwyLNG&redirect_uri=https%3A%2F%2Fmyapp.com%2Fauthorize&grant_type=authorization_code

Contributor guide

No contributing guide indexed for this repository

Research direction

Open the linked OAuth documentation at the “Implementing OAuth Flow” section and locate the paragraph 2 POST /api/token example. Update the example to include the specified redirect_uri parameter, then verify the rendered documentation shows the corrected request.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.