| @@ 50-64 (lines=15) @@ | ||
| 47 | * |
|
| 48 | * @return array |
|
| 49 | */ |
|
| 50 | public function getCodeFields($state = null) |
|
| 51 | { |
|
| 52 | $fields = [ |
|
| 53 | 'client_key' => $this->clientId, |
|
| 54 | 'redirect_uri' => $this->redirectUrl, |
|
| 55 | 'scope' => $this->formatScopes($this->scopes, $this->scopeSeparator), |
|
| 56 | 'response_type' => 'code', |
|
| 57 | ]; |
|
| 58 | ||
| 59 | if ($this->usesState()) { |
|
| 60 | $fields['state'] = $state; |
|
| 61 | } |
|
| 62 | ||
| 63 | return $fields; |
|
| 64 | } |
|
| 65 | ||
| 66 | /** |
|
| 67 | * 获取access_token地址. |
|
| @@ 390-404 (lines=15) @@ | ||
| 387 | * |
|
| 388 | * @return array |
|
| 389 | */ |
|
| 390 | protected function getCodeFields($state = null) |
|
| 391 | { |
|
| 392 | $fields = array_merge([ |
|
| 393 | 'client_id' => $this->clientId, |
|
| 394 | 'redirect_uri' => $this->redirectUrl, |
|
| 395 | 'scope' => $this->formatScopes($this->scopes, $this->scopeSeparator), |
|
| 396 | 'response_type' => 'code', |
|
| 397 | ], $this->parameters); |
|
| 398 | ||
| 399 | if ($this->usesState()) { |
|
| 400 | $fields['state'] = $state; |
|
| 401 | } |
|
| 402 | ||
| 403 | return $fields; |
|
| 404 | } |
|
| 405 | ||
| 406 | /** |
|
| 407 | * Format the given scopes. |
|