authlib icon indicating copy to clipboard operation
authlib copied to clipboard

Authlib httpx integration does not pass realm through.

Open schinckel opened this issue 4 years ago • 4 comments

The documentation for authlib.integrations.httpx_client.OAuth1Client suggests it supports passing in a realm argument, but it actually calls it OAuth1Session, which probably means it is a copy-paste from the requests section.

https://docs.authlib.org/en/latest/client/api.html?highlight=realm#authlib.integrations.httpx_client.OAuth1Client.fetch_request_token

Anyway, this value is not passed through to the underlying OAuth1Auth object, meaning my authentication was failing.

(My workaround is to set the client.auth.realm after instantiation, but it's still a bit of a PITA).

schinckel avatar Apr 21 '21 22:04 schinckel

Request and httpx are sharing the same fetch_request_token method in authlib.oauth1.client.

lepture avatar Apr 27 '21 03:04 lepture

Ah, so the documentation is auto-generated.

schinckel avatar Apr 27 '21 04:04 schinckel

Okay, so it seems like fetch_access_token would use the realm that is supplied as a kwarg, but other requests do not?

schinckel avatar Apr 27 '21 05:04 schinckel

I have the same issue. But setting client.auth.realm does not seem to work for me. It sets the oauth key in the header but my authentication still fails......

11philip22 avatar Jun 23 '22 08:06 11philip22

Already fixed.

lepture avatar Nov 01 '22 12:11 lepture