Some clients might add extra parameters to the redirect_uri, for instance as extra verification if proper state parameter handling is not supported. This patch adds proper handling of redirect_uris with query parameters.