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

Conversation

Zegnat
Copy link
Member

@Zegnat Zegnat commented Nov 22, 2020

More strictly define the requests we expect clients to send to the endpoints, outside of just the (generally treated as non-normative) examples. This adds:

  1. The requirement for an HTTP Accept header of application/json when redeeming the authorization code. This hopefully avoids new clients having problems with old authorization endpoints that could have answered with an application/x-www-form-urlencoded response.
  2. The requirement for an HTTP Accept header of application/json when verifying a Bearer Token at the token endpoint.

As it ads language about the Accept header, it also clarifies the use of URL spec's application/x-www-form-urlencoded format and its matching Content-Type header to the redeem step.

Fixes #18. (I think.)

@aaronpk
Copy link
Member

aaronpk commented Nov 22, 2020

Do we know how many servers currently default to form-encoded responses still? I'm still on the fence about adding this since it's not a requirement of OAuth 2.0, and is really only needed for backwards compatibility with older IndieAuth clients. I think I would still like to make a push to update servers to default to the JSON responses instead.

@Zegnat
Copy link
Member Author

Zegnat commented Nov 22, 2020

I am not sure. Back in 2017 there was a discussion on Selfauth because of Telegraph not supporting JSON. But Selfauth has always preferred serving JSON over form-urlencoded unless a server specifically asked for form-urlencoded. And that was 3 years ago...

Selfauth does not currently answer when no Accept header is provided, I think. In that case it will throw an HTTP 406 Not Acceptable. But that is not really IndieAuth spec specific and just Selfauth being overly strict.

We may be talking about 2017 and earlier clients and servers here.

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.

recommend/require Accept-headers, and show them in examples
2 participants