| @@ 70-77 (lines=8) @@ | ||
| 67 | ||
| 68 | public function getAccessToken() |
|
| 69 | { |
|
| 70 | if (!$this->isStateless) { |
|
| 71 | $expectedState = $this->getSession()->get(self::OAUTH2_SESSION_STATE_KEY); |
|
| 72 | $actualState = $this->getCurrentRequest()->query->get('state'); |
|
| 73 | if (!$actualState || ($actualState !== $expectedState)) { |
|
| 74 | $this->logger->error(__CLASS__.' ('.__LINE__.'): '.'Invalid state: '.var_export(var_export($actualState, 1).var_export($expectedState, 1), 1), 401); |
|
| 75 | throw new InvalidStateException('error_oauth_invalid_state'); |
|
| 76 | } |
|
| 77 | } |
|
| 78 | ||
| 79 | $code = $this->getCurrentRequest()->get('oauth_verifier'); |
|
| 80 | $token = $this->getCurrentRequest()->get('oauth_token'); |
|
| @@ 55-62 (lines=8) @@ | ||
| 52 | ||
| 53 | public function getAccessToken(array $attributes = []) |
|
| 54 | { |
|
| 55 | if (!$this->isStateless) { |
|
| 56 | $expectedState = $this->getSession()->get(self::OAUTH2_SESSION_STATE_KEY); |
|
| 57 | $actualState = $this->getCurrentRequest()->query->get('state'); |
|
| 58 | if (!$actualState || ($actualState !== $expectedState)) { |
|
| 59 | $this->logger->error(__CLASS__.' ('.__LINE__.'): '.'Invalid state: '.var_export(var_export($actualState, 1).var_export($expectedState, 1), 1), 401); |
|
| 60 | throw new InvalidStateException('error_oauth_invalid_state'); |
|
| 61 | } |
|
| 62 | } |
|
| 63 | ||
| 64 | $code = $this->getCurrentRequest()->get('code'); |
|
| 65 | ||