'Extracts parameters from query, headers and body. Signature type
is set to the source in which parameters were found.'

def get_signature_type_and_params(self, request):

    header_params = signature.collect_parameters(headers=request.headers, exclude_oauth_signature=False)
    body_params = signature.collect_parameters(body=request.body, exclude_oauth_signature=False)
    query_params = signature.collect_parameters(uri_query=request.uri_query, exclude_oauth_signature=False)
    params = []
    params.extend(header_params)
    params.extend(body_params)
    params.extend(query_params)
    signature_types_with_oauth_params = filter((lambda s: s[2]), ((SIGNATURE_TYPE_AUTH_HEADER, params, utils.filter_oauth_params(header_params)), (SIGNATURE_TYPE_BODY, params, utils.filter_oauth_params(body_params)), (SIGNATURE_TYPE_QUERY, params, utils.filter_oauth_params(query_params))))
    if (len(signature_types_with_oauth_params) > 1):
        raise ValueError(('oauth_    params    must    come    from    only    1    signature    type    but    were    found    in    %s' % ',    '.join([s[0] for s in signature_types_with_oauth_params])))
    try:
        (signature_type, params, oauth_params) = signature_types_with_oauth_params[0]
    except IndexError:
        raise ValueError('oauth_    params    are    missing.    Could    not    determine    signature    type.')
    return (signature_type, params, oauth_params)
