def METHOD_NAME(cls, config: Mapping[str, Any]) -> TokenAuthenticator:
    """
    Validate input parameters and generate a necessary Authentication object
    This connectors support 2 auth methods:
    1) direct access token with TTL = 2 months
    2) refresh token (TTL = 1 year) which can be converted to access tokens
       Every new refresh revokes all previous access tokens q
    """
    auth_method = config.get("credentials", {}).get("auth_method")
    if not auth_method or auth_method == "access_token":
        # support of backward compatibility with old exists configs
        access_token = config["credentials"]["access_token"] if auth_method else config["access_token"]
        return TokenAuthenticator(token=access_token)
    elif auth_method == "oAuth2.0":
        return Oauth2Authenticator(
            token_refresh_endpoint="https://www.linkedin.com/oauth/v2/accessToken",
            client_id=config["credentials"]["client_id"],
            client_secret=config["credentials"]["client_secret"],
            refresh_token=config["credentials"]["refresh_token"],
        )
    raise Exception("incorrect input parameters")