botocore icon indicating copy to clipboard operation
botocore copied to clipboard

sso-oidc exceptions don't translate "error_description" into ClientError message field

Open benkehoe opened this issue 5 years ago • 3 comments

The sso-oidc method CreateToken returns an error response that looks like:

{"error": "invalid_grant", "error_description": "Invalid grant provided"}

but on the botocore.errorfactory.InvalidGrantException object, the error.response["Error"]["Code"] is correct but error.response["Error"]["Message"] is an empty string.

This is using botocore 1.19.13

benkehoe avatar Nov 13 '20 00:11 benkehoe

@benkehoe - Thank you for your post. While parsing a service response we expect the service to send error message with message attribute https://github.com/boto/botocore/blob/develop/botocore/parsers.py#L638

But in this case as the service is sending error_description instead of message, botocore is not able to parse that. Marking it as feature request.

swetashre avatar Nov 13 '20 22:11 swetashre

Thanks. Seems like it should be part of the response shape. In this case, the error_description field is required by the OAuth spec: https://tools.ietf.org/html/rfc6749#section-5.2

benkehoe avatar Nov 16 '20 13:11 benkehoe

Greetings! It looks like this issue hasn’t been active in longer than one year. We encourage you to check if this is still an issue in the latest release. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or upvote with a reaction on the initial post to prevent automatic closure. If the issue is already closed, please feel free to open a new one.

github-actions[bot] avatar Mar 25 '22 22:03 github-actions[bot]