mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-01-09 05:23:53 +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(
|
private $_grantTypes = array(
|
||||||
'authorization_code',
|
'authorization_code',
|
||||||
'user_credentials',
|
'password',
|
||||||
'refresh_token',
|
'refresh_token',
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -379,7 +379,7 @@ class Server
|
|||||||
return $this->completeAuthCodeGrant($authParams, $params);
|
return $this->completeAuthCodeGrant($authParams, $params);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'user_credentials':
|
case 'password':
|
||||||
return $this->completeUserCredentialsGrant($authParams, $params);
|
return $this->completeUserCredentialsGrant($authParams, $params);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -542,7 +542,7 @@ class Server
|
|||||||
$params = array();
|
$params = array();
|
||||||
|
|
||||||
if ( ! isset($authParams['user_auth_callback'])) {
|
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
|
// Client ID
|
||||||
@ -582,7 +582,7 @@ class Server
|
|||||||
$params['grant_type'] = $_POST['grant_type'];
|
$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
|
// Check if user's u+p are correct
|
||||||
$userId = call_user_func($authParams['user_auth_callback']);
|
$userId = call_user_func($authParams['user_auth_callback']);
|
||||||
|
Loading…
Reference in New Issue
Block a user