Allow passing custom headers to metadata request in authorize_redirect#710
Conversation
|
Hello. Thank you for your contribution. Would you consider adding some unit tests? |
|
Hello. Unfortunately I don't have any experience in unit testing. Having said that, I am willing to give it a try. Perhaps you could suggest a file from the tests of the project, to serve as an example for me? |
| if self.client_kwargs is None: | ||
| self.client_kwargs = {} |
There was a problem hiding this comment.
Is this needed as client_kwargs is automatically initialized as an empty dict when a None value is passed?
https://github.com/lepture/authlib/blob/da87c8b2ec35af9ddd3b621e2e8245102018f878/authlib/integrations/base_client/sync_app.py#L217
There was a problem hiding this comment.
You are correct, thanks for pointing it out. I also cleaned the other changes a bit.
58f6776 to
eaf1e5a
Compare
|
I appreciate the guidance. I'll get on with adding the tests. |
This pull request implements a feature to allow custom HTTP headers to be passed to the metadata request made by
authorize_redirect().Previously (#633), when calling
authorize_redirect(redirect_uri, headers=headers), the custom headers were not forwarded to the GET request for server metadata, causing a 401 Unauthorized error when the endpoint was protected by a security gateway.What kind of change does this PR introduce? (check at least one)
Does this PR introduce a breaking change? (check one)