What is the string id under the ApiKeyAuthenticationCredential .Net API referring to

Hello, within the .Net API, one of the constructor for new ApiKeyAuthenticationCredentials wants me to supply string id and the string apikey for the authentication. I am wondering what is it looking for? I tried the different string: the endpoint string, "search-key", "Authorization", "X-API-KEY"

Hi, @Raymond_Lei. When you create an API key in Elasticsearch, you receive the following response:

  "id": "VuaCfGcBCdbkQm-e5aOx",        
  "name": "my-api-key",
  "expiration": 1544068612110,         
  "api_key": "ui2lp2axTNmsyakw9tvNnw", 
  "encoded": "VnVhQ2ZHY0JDZGJrUW0tZTVhT3g6dWkybHAyYXhUTm1zeWFrdzl0dk5udw=="  

The ApiKeyAuthenticationCredentials type accepts either, the id + api_key values as parameters, in which case the client handles concatenating those and encoding them for use when authenticating. You may also choose the overload which accepts a single string for the encoded key. So you may choose whichever best fits your scenario.

Thank you!

I have more question, is there a different between Elasticsearch API Client vs Enterprise App Search Client? Is the ElasticsSearch .NET client interchangeable between the two? or it is only for the former?

If not, is .Net Client supported for the latter? I didn't find the .Net client from the following page:
Programming language clients | Elastic Enterprise Search Documentation [8.0] | Elastic

Thank you again

Hey @Raymond_Lei. Sorry for the delay.

The current client is specifically for Elasticsearch. We don't currently have an Enterprise Search client for .NET but it is on the roadmap.

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