Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OAuth1 - Adding parameter to authorization header #812

Open
michaelvli opened this issue Apr 1, 2022 · 1 comment
Open

OAuth1 - Adding parameter to authorization header #812

michaelvli opened this issue Apr 1, 2022 · 1 comment

Comments

@michaelvli
Copy link

michaelvli commented Apr 1, 2022

Is there a way to add a custom parameter to the authorization header? I'm using OAuth1 to make an API call that requires the parameter, "diffie_hellman_challenge" in the authorization header. I saw that in 2014, there was a similar request: requests/requests-oauthlib#125

Instead of limiting the parameters to specific keywords, would it be possible to make the function cycle through a generic list parameters? Many thanks!

@tomaikido
Copy link

Also looking for a way to add the same into the Auth header. It doesn't look like there's a good way to do what we want. I also came across requests-oauthlib/issues/125 and attempted to do something along the lines of:

class AuthClient(Client):
    def get_oauth_params(self, request):
        params = super(AuthClient, self).get_oauth_params(request)
        if "diffie_hellman_challenge" in request._params:
            params.append(('diffie_hellman_challenge', request._params["diffie_hellman_challenge"]))
        return params

But because param doesn't start with oauth_ it gets stripped out in the method filter_oauth_params(params) in here. I'm starting to think that I might just have to write a method to construct the header manually.

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

No branches or pull requests

3 participants