mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-11-15 09:47:46 +05:30
Changing 'user_credentials' to password
This commit is contained in:
parent
2fecadd2a6
commit
89e89a73dc
@ -48,7 +48,7 @@ class Server
|
||||
*/
|
||||
private $_grantTypes = array(
|
||||
'authorization_code',
|
||||
'user_credentials',
|
||||
'password',
|
||||
'refresh_token',
|
||||
);
|
||||
|
||||
@ -379,7 +379,7 @@ class Server
|
||||
return $this->completeAuthCodeGrant($authParams, $params);
|
||||
break;
|
||||
|
||||
case 'user_credentials':
|
||||
case 'password':
|
||||
return $this->completeUserCredentialsGrant($authParams, $params);
|
||||
break;
|
||||
|
||||
@ -542,7 +542,7 @@ class Server
|
||||
$params = array();
|
||||
|
||||
if ( ! isset($authParams['user_auth_callback'])) {
|
||||
throw new \InvalidArgumentException('You must set a user_auth_callback when using the user_credentials grant type.');
|
||||
throw new \InvalidArgumentException('You must set a user_auth_callback when using the password grant type.');
|
||||
}
|
||||
|
||||
// Client ID
|
||||
@ -582,7 +582,7 @@ class Server
|
||||
$params['grant_type'] = $_POST['grant_type'];
|
||||
}
|
||||
|
||||
if ($params['grant_type'] == 'user_credentials')
|
||||
if ($params['grant_type'] == 'password')
|
||||
{
|
||||
// Check if user's u+p are correct
|
||||
$userId = call_user_func($authParams['user_auth_callback']);
|
||||
|
Loading…
Reference in New Issue
Block a user