Skip to content

Mt 1892 handle oauth errors - #1

Open
gerard-mailtrack wants to merge 4 commits into
masterfrom
MT-1892-handle-oauth-errors
Open

gerard-mailtrack wants to merge 4 commits into
masterfrom
MT-1892-handle-oauth-errors

Conversation

@gerard-mailtrack

Copy link
Copy Markdown

Created just for easier review.

try {
$authorizationUrl = $this->container->get('hwi_oauth.security.oauth_utils')->getAuthorizationUrl($request, $service);
} catch (\RuntimeException $e) {
throw new NotFoundHttpException($e->getMessage(), $e);

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes issue: Invalid Resource owner errors do not throw CRITICAL error

Exception was not caught. We just rethrow as 404.

$this->httpClient->send($request, $response);
} catch (ClientException $e) {
throw new HttpTransportException('Error while sending HTTP request', $this->getName(), $e->getCode(), $e);
// Do nothing: user will be redirected to failure_path

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes issue: Google API errors generate CRITICAL error.

We just keep going on without useful user, and the error happens later and is handled appropriately.

Comment thread Security/OAuthUtils.php
$extraParameters = array_merge($extraParameters, $extraSessionParameters);
$session->remove($sessionKey);
}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes issue: Missing refresh tokens after signin up with permissions granted.

This allows to perform an auth retry with additional options, after an error is detected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant