NEST client with BasicAuthentication and SecureString


I am currently initializing the ElasticClient like below

    var settings = new ConnectionSettings(new Uri(mEsQuerySource.Url));
    settings.BasicAuthentication("user", "plain text password");
    mClient = new ElasticClient(settings);

But I don't want to copy my password from SecureString to plain string. Is there a way that I provide directly my SecureString for BasicAuthentification?

In fact, I want to use "NetworkCredential(string userName, SecureString password)" with NEST client.


Hi Niaz,

Unfortunately, no. NEST currently doesn't support SecureString. However I think it's worth considering- I've opened

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.