diff options
author | jonathan vanasco <jonathan@2xlp.com> | 2018-09-17 19:54:37 -0400 |
---|---|---|
committer | jonathan vanasco <jonathan@2xlp.com> | 2018-09-17 19:54:37 -0400 |
commit | b4ceb8a7fae065817f86c259dfbf91344ecb2925 (patch) | |
tree | 806d1a2806259a3fd6ea11108be2939842527496 /oauthlib/oauth2/rfc6749/clients/backend_application.py | |
parent | e7bd936434f7268b0453fd25c637034f7efd8168 (diff) | |
download | oauthlib-b4ceb8a7fae065817f86c259dfbf91344ecb2925.tar.gz |
migrated `include_client_id` to `prepare_request_token`
Diffstat (limited to 'oauthlib/oauth2/rfc6749/clients/backend_application.py')
-rw-r--r-- | oauthlib/oauth2/rfc6749/clients/backend_application.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/oauthlib/oauth2/rfc6749/clients/backend_application.py b/oauthlib/oauth2/rfc6749/clients/backend_application.py index 99dbfc5..cd46f12 100644 --- a/oauthlib/oauth2/rfc6749/clients/backend_application.py +++ b/oauthlib/oauth2/rfc6749/clients/backend_application.py @@ -30,7 +30,8 @@ class BackendApplicationClient(Client): no additional authorization request is needed. """ - def prepare_request_body(self, body='', scope=None, **kwargs): + def prepare_request_body(self, body='', scope=None, + include_client_id=None, **kwargs): """Add the client credentials to the request body. The client makes a request to the token endpoint by adding the @@ -41,6 +42,14 @@ class BackendApplicationClient(Client): into. This may contain extra paramters. Default ''. :param scope: The scope of the access request as described by `Section 3.3`_. + + :param include_client_id: `True` to send the `client_id` in the body of + the upstream request. Default `None`. This is + required if the client is not authenticating + with the authorization server as described + in `Section 3.2.1`_. + :type include_client_id: Boolean + :param kwargs: Extra credentials to include in the token request. The client MUST authenticate with the authorization server as @@ -58,5 +67,7 @@ class BackendApplicationClient(Client): .. _`Section 3.3`: https://tools.ietf.org/html/rfc6749#section-3.3 .. _`Section 3.2.1`: https://tools.ietf.org/html/rfc6749#section-3.2.1 """ + kwargs['client_id'] = self.client_id + kwargs['include_client_id'] = include_client_id return prepare_token_request('client_credentials', body=body, scope=scope, **kwargs) |