Conditions | 1 |
Paths | 1 |
Total Lines | 12 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 1.0019 |
Changes | 0 |
1 | <?php |
||
20 | 1 | public function getToken($username, $password, $clientId = self::CLIENT_NODE_RED_ADMIN, $scope = self::SCOPE_ALL) |
|
21 | { |
||
22 | 1 | $data = $this->instance->formPost('auth/token', [ |
|
23 | 1 | 'grant_type' => 'password', |
|
24 | 1 | 'username' => $username, |
|
25 | 1 | 'password' => $password, |
|
26 | 1 | 'client_id' => $clientId, |
|
27 | 'scope' => $scope |
||
28 | 1 | ]); |
|
29 | |||
30 | return new OAuthToken($data['access_token'], $data['expires_in'], $data['token_type']); |
||
31 | } |
||
32 | } |
||
33 |