'Extract grant_type and route to the designated handler.'

@catch_errors_and_unavailability
def create_token_response(self, uri, http_method=u'GET', body=None, headers=None, credentials=None, grant_type_for_scope=None, claims=None):

    request = Request(uri, http_method=http_method, body=body, headers=headers)
    request.scopes = utils.scope_to_list(request.scope)
    request.extra_credentials = credentials
    if grant_type_for_scope:
        request.grant_type = grant_type_for_scope
    if claims:
        request.claims = claims
    grant_type_handler = self.grant_types.get(request.grant_type, self.default_grant_type_handler)
    log.debug(u'Dispatching    grant_type    %s    request    to    %r.', request.grant_type, grant_type_handler)
    return grant_type_handler.create_token_response(request, self.default_token_type)
