def decode_authorization_header(header):
    """ Decodes a HTTP Authorization Header to python dictionary """
    authorization = header.get("Authorization", "").lstrip(" ").lstrip("OAuth")
    tokens = {}

    for param in authorization.split(","):
        try:
            key, value = param.split("=")
        except ValueError:
            continue
 
        key = key.lstrip(" ")
        value = value.lstrip(" ").lstrip('"')
        value = value.rstrip(" ").rstrip('"')

        tokens[key] = value

    return tokens