def METHOD_NAME(issuer):
    """
    From the provided issuer, use OAuth auto-discovery to bootstrap the token endpoint.
    """
    parse_result = urlparse.urlparse(issuer)
    norm_path = os.path.normpath(parse_result.path)
    new_path = norm_path if norm_path != "/" else ""
    new_path = "/.well-known/oauth-authorization-server" + new_path
    config_url = urlparse.urlunparse(urlparse.ParseResult(
        scheme = "https",
        netloc = parse_result.netloc,
        path = new_path,
        fragment = "",
        query = "",
        params = ""))
    response = requests.get(config_url)
    endpoint_info = json.loads(response.text)
    if response.status_code != requests.codes.ok:
        print >> sys.stderr, "Failed to access the auto-discovery URL (%s) for issuer %s (status=%d): %s" % (config_url, issuer, response.status_code, response.text[:2048])
        raise NoTokenEndpoint()
    elif 'token_endpoint' not in endpoint_info:
        print >> sys.stderr, "Token endpoint not available for issuer %s" % issuer
        raise NoTokenEndpoint()
    return endpoint_info['token_endpoint']