watson-developer-cloud / node-red-node-watson

A collection of nodes for the IBM Watson services
Apache License 2.0
82 stars 86 forks source link

Using Watson Assistant with a username and password (setting username to apikey and password to the apikey value itself) does not work #480

Closed jfmartinez closed 3 years ago

jfmartinez commented 3 years ago

Hello, Using Watson Assistant setting username to apikey and password to the apikey value does not work. It results in this exception:

10/23/2020, 11:08:25 AMnode: 8a63cfd8.d90b28 msg : string[35] "Missing required parameters: apikey"

I've looked through the code and I can see the problem is that the node seems to create an IAMAuthenticator even when no apikey is specified: https://github.com/watson-developer-cloud/node-red-node-watson/blob/master/services/assistant/v1.js#L216

chughts commented 3 years ago

If you have a real username and password (not apikey) then you can use those fields. New username / password combinations haven't been issued for a while now, so I expect very few people to be using those fields.

Otherwise if you have an apikey then you should be using only the apikey field, and not the username / password fields.

jfmartinez commented 3 years ago

In the latest version real username/passwords do not work either because of the error I mentioned earlier.

chughts commented 3 years ago

Do you have a real username / password - and not apikey ? As there shouldn't be any real username / passwords, we need to remove them from the configuration. I'll add that as a change request.

jfmartinez commented 3 years ago

I do not (like you said those have been deprecated for a while now). Mainly, my team and I have used the username/password fields to make requests to Watson Assistant using basic authentication. We were planning on using this to run some smoke tests for some Watson assistant staging endpoints, and I understand why you need remove them from the configuration.

For us at least, it would be cool, if there was a flag in the node configuration that you could choose to use Basic auth with the (apikey/{apikey value}) or at the least configure the IAM Token Endpoint.