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

Wrong response when using password grant_type and invalid user credentials #59

Open
koemeet opened this issue Mar 14, 2014 · 2 comments

Comments

@koemeet
Copy link

koemeet commented Mar 14, 2014

Hi,

When you're requesting an access token based of user credentials, you get a wrong response when your credentials are invalid.

Expected result:

{
  "error_description" : "Invalid username and password combination",
  "error" : "invalid_grant"
}

Instead, it only returns:

{
  "error" : "invalid_grant"
}

I will create a pull-request if necessary.

Best wishes,
Steffen Brem

koemeet added a commit to koemeet/oauth2-php that referenced this issue Mar 14, 2014
@koemeet koemeet mentioned this issue Mar 14, 2014
koemeet added a commit to koemeet/oauth2-php that referenced this issue Mar 14, 2014
koemeet added a commit to koemeet/oauth2-php that referenced this issue Mar 14, 2014
koemeet added a commit to koemeet/oauth2-php that referenced this issue Mar 14, 2014
alanbem added a commit that referenced this issue Mar 14, 2014
@a6software
Copy link

I think the error here is self::HTTP_UNAUTHORIZED rather than self::HTTP_BAD_REQUEST.

I know that's not the change you made, but would appreciate your input on this anyway.

The RFC for these two says:

 invalid_request
       The request is missing a required parameter, includes an
       unsupported parameter or parameter value, or is otherwise
       malformed.

 access_denied
       The resource owner or authorization server denied the
       request.

The issue here being that throwing a 400 implies one of the two params is missing from the request, or is of the wrong type. Whereas supplying both username and password - where one of the two turn out to be invalid - should return a 401.

I've made the change locally and done some manual tests and everything seems to work properly, but would appreciate a second opinion on this.

@ghost
Copy link

ghost commented Jul 12, 2018

Do you know what's the cause of

{
    "error": "invalid_client"
}

?

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

2 participants