'Create a new access token from a refresh_token.
If valid and authorized, the authorization server issues an access
token as described in `Section 5.1`_. If the request failed
verification or is invalid, the authorization server returns an error
response as described in `Section 5.2`_.
The authorization server MAY issue a new refresh token, in which case
the client MUST discard the old refresh token and replace it with the
new refresh token. The authorization server MAY revoke the old
refresh token after issuing a new refresh token to the client. If a
new refresh token is issued, the refresh token scope MUST be
identical to that of the refresh token included by the client in the
request.
.. _`Section 5.1`: http://tools.ietf.org/html/rfc6749#section-5.1
.. _`Section 5.2`: http://tools.ietf.org/html/rfc6749#section-5.2'

def create_token_response(self, request, token_handler):

    headers = {u'Content-Type': u'application/json', u'Cache-Control': u'no-store', u'Pragma': u'no-cache'}
    try:
        log.debug(u'Validating    refresh    token    request,    %r.', request)
        self.validate_token_request(request)
    except errors.OAuth2Error as e:
        return (headers, e.json, e.status_code)
    token = token_handler.create_token(request, refresh_token=self.issue_new_refresh_tokens)
    log.debug(u'Issuing    new    token    to    client    id    %r    (%r),    %r.', request.client_id, request.client, token)
    return (headers, json.dumps(token), 200)
