python-oauth2 icon indicating copy to clipboard operation
python-oauth2 copied to clipboard

get_normalized_parameters does not take into account the 2 legged OAuth with oauth params in the URL

Open gregtap opened this issue 15 years ago • 2 comments

hello,

While tweaking around to get two legs OAuth working I realised that get_normalized_parameters in Request does not take into accoutn the case where the URL has oauth authentification GET variables like the following:

api/v2.1/users?oauth_nonce=34400401&oauth_timestamp=1276109986&oauth_consumer_key=N_S3ZhJypOv1CW3IWa&oauth_signature_method=HMAC-SHA1&oauth_version=1.0&oauth_signature=AuJ6QulDbLkWz9Ss%2FbbBMKerLKw%3D HTTP/1.1"

Which is valid.

We just need to add something like

    get_items = self._split_url_string(query).items()
    non_getl_items = list([(k, v) for k, v in url_items  if not k.startswith('oauth_')])

Or i missed something obvious.

gregtap avatar Jun 09 '10 19:06 gregtap

I was wrong,

I just added a _check_two_legged_signature with a small tweak where

    request.url = request.normalized_url

gregtap avatar Jun 10 '10 08:06 gregtap

Part of the normalisation issues... #111

jaitaiwan avatar Jul 29 '15 12:07 jaitaiwan