The authlib documentation discusses how to process HMAC-SHA256
signature methods server side, but there doesn't seem to be anything about how to sign requests with this kind of signature.
The following code fails with a ValueError: Invalid signature method.
auth = OAuth1Auth(
client_id="...",
client_secret="...",
token="...",
token_secret="...",
realm="...",
signature_method= "HMAC-SHA256",
)
r = requests.post(url, auth=auth, data=payload)
Is there a way to issue requests with HMAC-SHA256
, or is this not supported?
There is a blog post about using HMAC-SHA256 in OAuth 1 client:
https://blog.authlib.org/2023/oauth1-hmac-sha256
Copy the code here: