httpx_auth
httpx_auth copied to clipboard
Allow nest token_field_name with OAuth2ClientCredentials
My use case is simple, I need to use a OAuth2ClientCredentials authentication flow, but my access token is not returned at the top-level of the response's JSON body, instead, the field is nested, i.e.
{
"tokenData": {
"access_token": "tYGB6EHKxzMs9ecUFhPxDtXflaPKqHACIvcrd4Wx",
"token_type": "Bearer",
"expires_in": 60000
},
"errors": [],
"success": true
}
My proposed solution would be to allow the token_field_name parameter to be a tuple, to reflect the nested structure (i.e. ("tokenData", "access_token"))
Hello, while the use case is correct, the proposed solution is not enough as we need to extract the expiry as well (at least, there is also error management to do). Could you share what provider this is? Maybe they document what the provide in case of success and error ?