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

Require Accept headers in requests. #70

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion public/source/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,8 @@
<li><code>code_verifier</code> - The original plaintext random string generated before starting the authorization request.</li>
</ul>

<p>The POST request parameters MUST be formatted following how [[!URL]] defines <a href="https://url.spec.whatwg.org/#application/x-www-form-urlencoded"><code>application/x-www-form-urlencoded</code></a>. The POST request MUST define the <code>Content-Type</code> and <code>Accept</code> HTTP headers as <code>application/x-www-form-urlencoded</code> and <code>application/json</code> respectively.</p>

<b>Example request to authorization endpoint</b>
<pre class="example nohighlight"><?= htmlspecialchars(
'POST https://example.org/auth
Expand Down Expand Up @@ -689,7 +691,7 @@
<section>
<h4>Access Token Verification Request</h4>

<p>If a resource server needs to verify that an access token is valid, it MUST make a GET request to the token endpoint containing an HTTP <code>Authorization</code> header with the Bearer Token according to [[!RFC6750]]. Note that the request to the endpoint will not contain any user-identifying information, so the resource server (e.g. Micropub endpoint) will need to know via out-of-band methods which token endpoint is in use.</p>
<p>If a resource server needs to verify that an access token is valid, it MUST make a GET request to the token endpoint containing an HTTP <code>Authorization</code> header with the Bearer Token according to [[!RFC6750]] and an HTTP <code>Accept</code> header set to <code>application/json</code>. Note that the request to the endpoint will not contain any user-identifying information, so the resource server (e.g. Micropub endpoint) will need to know via out-of-band methods which token endpoint is in use.</p>

<pre class="example nohighlight">GET https://example.org/token
Authorization: Bearer xxxxxxxx
Expand Down Expand Up @@ -855,6 +857,7 @@
<h3>Changes from 26 September 2020 to this version</h3>
<ul>
<li>Remove same-domain requirement for entered and final profile URL by instead confirming the authorization server</li>
<li>Add normative requirement for Accept headers in requests outside of HTTP examples</li>
</ul>
</section>

Expand Down