summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksandr Vladimirskiy <aleksandr@butchershopcreative.com>2013-10-10 09:21:02 -0700
committerAleksandr Vladimirskiy <aleksandr@butchershopcreative.com>2013-10-10 09:21:02 -0700
commit5a85227295dbd7e23138acd921cc058206bb062c (patch)
tree5b6ba6df7653f549f49a14f5d349fd5fb69ae9a9
parent90c70eefd39cdde705c1b741cdb5acdf35cf9d5a (diff)
downloadoauthlib-5a85227295dbd7e23138acd921cc058206bb062c.tar.gz
Set headers on client credentials access token response
-rw-r--r--oauthlib/oauth2/rfc6749/grant_types/client_credentials.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/oauthlib/oauth2/rfc6749/grant_types/client_credentials.py b/oauthlib/oauth2/rfc6749/grant_types/client_credentials.py
index 6641f1f..e69e29d 100644
--- a/oauthlib/oauth2/rfc6749/grant_types/client_credentials.py
+++ b/oauthlib/oauth2/rfc6749/grant_types/client_credentials.py
@@ -61,6 +61,11 @@ class ClientCredentialsGrant(GrantTypeBase):
.. _`Section 5.1`: http://tools.ietf.org/html/rfc6749#section-5.1
.. _`Section 5.2`: http://tools.ietf.org/html/rfc6749#section-5.2
"""
+ headers = {
+ 'Content-Type': 'application/json;charset=UTF-8',
+ 'Cache-Control': 'no-store',
+ 'Pragma': 'no-cache',
+ }
try:
log.debug('Validating access token request, %r.', request)
self.validate_token_request(request)
@@ -71,7 +76,7 @@ class ClientCredentialsGrant(GrantTypeBase):
token = token_handler.create_token(request, refresh_token=False)
log.debug('Issuing token to client id %r (%r), %r.',
request.client_id, request.client, token)
- return {}, json.dumps(token), 200
+ return headers, json.dumps(token), 200
def validate_token_request(self, request):
if not getattr(request, 'grant_type'):