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

Empty response json specification #525

Closed
kevinbein opened this issue Feb 22, 2015 · 3 comments
Closed

Empty response json specification #525

kevinbein opened this issue Feb 22, 2015 · 3 comments

Comments

@kevinbein
Copy link

Is there any specification for the json response type when no authentication information is included in the request? http://tools.ietf.org/html/rfc6750#section-3.1 specifies that " [...] the resource server SHOULD NOT include an error code or other error information" but sending the response object of the oauth2 server results in [] with status code 401.

$globalRequest = Request::createFromGlobals();
if (!$oauth2Server->verifyResourceRequest($globalRequest, null)) {
    $response = $oauth2Server->getResponse();
    $response->send();
}

I'd either expect a blank response or an empty object {}. Using JSON_FORCE_OBJECT in Response::getResponseBody resolves this.

@bshaffer
Copy link
Owner

I believe we want no response. The [] (or even {}) is not desirable. Would you like to submit a PR to fix this?

@mehmedean
Copy link

Sending no access_token still results in [], is there any fix on this?

@mehmedean
Copy link

Thank you Brent, it now returns an empty response body.

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