nuxwin
Hi, I'm using latest version of the `requests-authlib`package. For our authorization server, we added support for audience claim, according [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707#name-resource-parameter). So, basically put, one client can request access to one or many resources by adding the `resource` parameter in the token request **body**. When requesting access to many resources, many 'resource' parameters need to be added into the token request rather than a single 'resource' parameter with space-separated resource values (resource URI), as it is done with scope claim. For instance, for a token request using the **client credentials grant** (POST request): ``` POST /token HTTP/1.1 Host: server.example.com Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxx Content-Type: application/x-www-form-urlencoded grant_type=client_credentials&resource=https//resourceserver1.example.com&resource=https//resourceserver2.example.com&scope=read+write ``` The problem is that with your current implementation, resulting **Request kwargs** are wrong. 1. Result when passing the multiple `resource` parameters through **kwargs**, as a list: ```python Request kwargs: {'data': {'grant_type': 'client_credentials', 'scope': 'read write', 'resource': "['https://resourceserver1.example.com', 'https://resourceserver2.example.com']"}} ``` As you can see the list of `resource`parameters is encoded as single string which is wrong. 2. Result when passing the multiple `resource`parameters through **body**: ```python Request kwargs: {'data': {'resource': 'https://resourceserver2.example.com', 'grant_type': 'client_credentials', 'scope': 'read write'}} ``` As you can see, only one `resource`parameter is kept which is wrong too. For the record, I tried with the following code: By passing multiple `resource` parameters in **body**: ```python token = OAuth2Session(client=BackendApplicationClient(client_id=client_id)).fetch_token( token_url='https://my-oauthorization-server.tld/o/token', client_id=client_id, client_secret=client_secret, body="resource=https://resourceserver1.example.com&resource=https://resourceserver2.example.com", scope=["read", "write"] ) ``` By passing multiple `resource` parameters as **kwargs**: ```python token = OAuth2Session(client=BackendApplicationClient(client_id=client_id)).fetch_token( token_url='https://my-oauthorization-server.tld/o/token', client_id=client_id, client_secret=client_secret, resource=["https://resourceserver1.example.com", "https://resourceserver2.example.com"], scope=["read", "write"] ) ``` Thank you.