Answer the question
In order to leave comments, you need to log in
How to get oauth2 token using UserCredentials method?
I'm trying to screw oauth2. I'm interested in the type of authentication namely user-credentials: https://bshaffer.github.io/oauth2-server-php-docs/... That is, by login and password.
Copy-paste from the docks:
$users = array('bshaffer' => array('password' => 'brent123', 'first_name' => 'Brent', 'last_name' => 'Shaffer'));
$storage = new \OAuth2\Storage\Memory(array('user_credentials' => $users));
$grantType = new \OAuth2\GrantType\UserCredentials($storage);
$server = new \OAuth2\Server($storage);
$server->addGrantType($grantType);
$server->handleTokenRequest(\OAuth2\Request::createFromGlobals())->send();
{"error":"invalid_client","error_description":"Client credentials were not found in the headers or body"}
Answer the question
In order to leave comments, you need to log in
This library obliges to transfer also client_id and client_secret
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question