1

I'm new to OAuth. I'm trying to implement https://github.com/lucadegasperi/oauth2-server-laravel#password-flow

I've already inserted id and secret into oauth_clients table. Also I have inserted username and password into users table. (via Phpmyadmin)

After I try to do the request:

POST http://localhost:8000/oauth/access_token?
grant_type=password&
client_id=weredfsdfsrq341&
client_secret=dfwefsdf&
[email protected]&
password=123456

But response is:

{
error: "invalid_request"
error_description: "The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the "client_id" parameter."
}

My route is

Route::post('oauth/access_token', function()
{
    return AuthorizationServer::performAccessTokenFlow();
});

What am I doing wrong?

2
  • Same probleme, do you have a solution? I'm upgrading v1 to v3 Commented Dec 9, 2014 at 15:04
  • Stuck with same issue: "The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the \"grant_type\" parameter." tried to change to x-www, same result Commented Jan 20, 2015 at 20:41

3 Answers 3

1

Not sure whether you found the answer to this, but, this is a bug in the package as discussed here Here

Basically when the content type is json the parameters are not handled correctly by the package. Fix: Locate $authorizer->setRequest($app['request']); in vendor/lucadegasperi/oauth-server-laravel/src/OAuth2ServerServiceProvider.php and add this line just above it

 $app['request']->replace(\Input::all());
Sign up to request clarification or add additional context in comments.

Comments

0

Please make sure the content type is set to "x-www-form-urlencoded" when you make that POST.

1 Comment

How do I store the access_token, so obtained, to a variable ?
0

I might be wrong, but I think you missed the parameter scope. Just a guess.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.