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

Need to be able to add headers when calling authorize_redirect() #633

Open
securitypedant opened this issue Mar 21, 2024 · 0 comments
Open

Comments

@securitypedant
Copy link

Is your feature request related to a problem? Please describe.

I am using your library with the Flask client for an OAuth 2.0 flow.

The resource I am using your library with is behind a security gateway that is expecting auth in the HTTP headers. This is fine when I call...

token = oauth.myapp.authorize_access_token(headers=headers)

I can pass in HTTP headers for the auth, so that when the token is requested, it is authenticated by the HTTP gateway infront of my token issuer.

However, when I call...

return oauth.myapp.authorize_redirect(redirect_uri)

It looks for the server metadata, and gets it from a URL I specify in the registration, i.e.

server_metadata_url='https://dash.staging.mycompany.com/.well-known/jwks.json'

and the authorize_redirect() makes the HTTP request, but fails. I need a way to pass HTTP headers into this function as well.

Describe the solution you'd like

I would like to be able to run...

return oauth.myapp.authorize_redirect(redirect_uri, headers=headers)

Where headers contains HTTP authentication data.

Describe alternatives you've considered

I tried passing in the headers, hoping that **kwargs would be passed through and at some point the headers respected. But it didn't work.

Additional context

None

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

No branches or pull requests

1 participant