Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

user name is empty error is shown if authentication is enabled #38

Closed
Nitin5acc opened this issue Nov 14, 2019 · 2 comments
Closed

user name is empty error is shown if authentication is enabled #38

Nitin5acc opened this issue Nov 14, 2019 · 2 comments
Projects

Comments

@Nitin5acc
Copy link

Describe the bug
When Authentication is enabled. I am not able to get the values.

user name is empty

is returned.

To Reproduce
_etcdClient = new dotnet_etcd.EtcdClient(_client.Settings.ConnectionString, _client.Settings.Port, _client.Settings.UserName,_client.Settings.Password);

a
Expected behavior
I should get the value ( ETCD cli does return the value)

@beckjin
Copy link

beckjin commented Nov 15, 2019

You can try it like this :

var client = new EtcdClient("http://127.0.0.1:2379");

var authRes = client.Authenticate(new Etcdserverpb.AuthenticateRequest { Name = "admin", Password = "123456" });

var header = new Metadata
{
  { "Authorization", authRes.Token }
};

var key = "/foo/bar";

client.Put("/foo/bar", "1", header);

@shubhamranjan
Copy link
Owner

You can try it like this :

var client = new EtcdClient("http://127.0.0.1:2379");

var authRes = client.Authenticate(new Etcdserverpb.AuthenticateRequest { Name = "admin", Password = "123456" });

var header = new Metadata
{
  { "Authorization", authRes.Token }
};

var key = "/foo/bar";

client.Put("/foo/bar", "1", header);

Yes. Documentation is something which is pending from long. I need to update them asap.

@shubhamranjan shubhamranjan added this to To Do in dotnet-etcd via automation Apr 6, 2020
@shubhamranjan shubhamranjan moved this from To Do to Done in dotnet-etcd Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
dotnet-etcd
  
Done
Development

No branches or pull requests

3 participants