IBM Watson Assistant: How to get IAM key for v1 watson assistant services - ibm-cloud

I have an IBM Watson Assistant service with username and password format and now I want to create new credentials which should have IAM key for this service, Please let us know how we can achieve this.

You can also migrate your Cloud Foundry service instance that uses un:pw to one that supports IAM. See Migrating Watson services from Cloud Foundry

There are (at least) two options to obtain IAM credentials for you IBM Watson Assistant service:
In the browser, go to the service dashboard by going to the IBM Cloud resources portal, locate your service instance, click on it and then in its dashboard on Service credentials. There you can create new credentials.
In a terminal and using the IBM Cloud CLI you can use ibmcloud resource service-key-create to generate credentials.
Both options assume that you have migrated your service instance from Cloud Foundry to IAM.

For creating a new credential, you can directly go to your watson assistant service/resource page, once there, on the left hand side, you would find "Service Credentials" menu button, there you would find an option to create a "New credential", and once the credential is created, then the "apikey" of that "New credential", would actually be your "IAM key", which can be viewed by clicking on the "View Credential" button highlighted below in the image.
*This is for IBM Watson Assistant V1 only.

Related

Watson Assistant and node-red

I am trying to use node-red to connect to my Watson chatbot using the Watson assistant v2 node. For some reason, I keep getting forbidden returns and It doesn't seem to connect properly? Has anyone managed to successfully connect to a Watson service using Node-red?
I am not sure the correct combination of API key or ID to connect to the correct service
In the Watson Assistant UI go to the Assistant you want to use, then to the Settings section. The Assistant ID and URL are shown, then in the Service credentials section the API key.
Enter them in the configuration of your node.
For those who came late for this question:
To use IBM watson node-red nodes
search for the service in IBM cloud.
Create the service.
Get the credentials.
Go to node-red editor and paste the credentials (API key + URL)

Where to find IBM Cloud Function credentials to access it for Watson Assistant

I am searching for the credentials to access my cloud function from Watson assistant. Both are in Dallas region.
I have looked at various docs and blogs, all looks obsolete. I could not find the credentials that could work in Watson Assistant.
Below is one example location where i could not find credentials:
https://developer.ibm.com/recipes/tutorials/connect-watson-assistant-with-wikipedia-api-via-cloud-functions/
Could someone provide me steps or link to find or generate credentials?
More trials added
https://cloud.ibm.com/docs/services/assistant?topic=assistant-dialog-actions
above link provide another link that is supposed to show me credentials but no success
Note: I can see CF-based API key for the namespace in London but not in Dallas on link -- https://cloud.ibm.com/functions/namespace-settings
Namespace
Below is a part of Watson json.
"actions": [
{
"name": "Namespace-Y1N/irs/helloworld",
"type": "cloud_function",
"parameters": {
},
"credentials": "$private.my_creds",
"result_variable": "$my_result"
}
]
Below is the cloud function
Well, the official IBM Watson Assistant docs on creating programmatic calls have that information. Look for <reference_to_credentials>. There are instructions on how to access Cloud Functions and extract the API key. Some of that is not needed if working with web actions.
The official tutorial on how to build a database-driven Slackbot with Watson Assistant also offers a way on integrating those credentials once for multiple dialog nodes. It uses a "credential node" to manage the info on how to access Cloud Function actions.
Note that Cloud Functions have the old Cloud Foundry-based namespaces and the new IAM-based namespaces. You can only see the authentication key for the Cloud Foundry namespaces. It seems that your Dallas namespace is new and IAM-enabled.
As an alternative, use the IBM Cloud CLI, log in to your org / space or namespace and then use this command to obtain the Cloud Function properties including the authentication key:
ibmcloud fn property get --auth
Create a new API key. Select Menu(Top-left), Manage, Access (AIM), IBM Cloud API Keys. Create an IBM Cloud API Key, then make sure that you save it somewhere because you will never see the key again. I hope that will help.
Your namespace "Namespade-Y1N" in Dallas is a IAM-enabled namespace. Server-based actions in dialog node of Watson Assistant does not support IAM based authentication. It can only work with CF based namespaces and CF based Cloud foundry functions. This is restriction of Watson Assistant.

Conversation connector / Watson Assistant: How to change account or workspace?

I am using the Conversation connector to implement a Slackbot with Watson Assistant. I want to move the chatbot over to another account and workspace. How can I do that without redeploying the Conversation connector and changing something in Slack?
I found that I can edit the configuration document stored in the described authdb.
In the IBM Cloud dashboard locate the Cloudant service named conversation-connector.
Click on that service and go to the Cloudant dashboard.
Click on the authdb database. There should be a single doc in it.
Edit the section conversation and adapt the username / password / workspace_id to the new values.
Save changes. Done.

how external app can access ibm cloud object storage

I have IBM COS service and able to use Curl command via cli to retrieve objects. I used IAM tokens to retrieve. But how do I let an external web app ex., node access this service?
what value should be there in authorization for external app access?
External apps will come in the form of something like the AWS CLI or any other app that uses either an HTTP library coupled with IBM Cloud Object Storage API or even an SDK for languages like Python, Java or Node.Js
All of the above will ask you for access key and secret key.
You can get both of them from the IBM Cloud console by generating new HMAC Credentials [1]:
Navigate to your Cloud Object storage account
Click on right under Service credentials
Click New credentials button on right
For the "Add Inline Configuration Parameters (Optional)" text box enter the following JSON:
{"HMAC":true}
[1] https://console.bluemix.net/docs/services/cloud-object-storage/iam/service-credentials.html#service-credentials
We'll you could use the ibm-cos-sdk Node library https://www.npmjs.com/package/ibm-cos-sdk. You'll need to use your HMAC credentials.
var config = {
endpoint: '<endpoint>',
ibmAuthEndpoint: 'https://iam.ng.bluemix.net/oidc/token',
serviceInstanceId: '<resource-instance-id>',
accessKeyId: '<HMAC access_key>',
secretAccessKey: '<HMAC secret access key>'
};

How to retrieve service credentials for Hyperledger on Kubernetes Cluster on Bluemix

I recently installed Hyperledger on a Kubernetes cluster on IBM Bluemix trial account.
I want to use the Hyperledger Fabric SDK Node.js to access my blockchain. I am following the instructions to run the HLF SDK sample helloblockchain.js
https://github.com/IBM-Blockchain-Archive/SDK-Demo
I need to be able to retrieve my "service credentials". Since this is not the enterprise install on Bluemix I do not have a blockchain dashboard from which I can view credentials. How do I find my credentials to create the ServiceCredentials.json file?
Clarification:
When you install Hyperledger in a bluemix trial in a container you do not have the same Blockchain dashboard as you do if you added the Blockchain Enterprise service.
blockchain dashboard in trial account
If you click on the blockchain item you get the cluster dashboard. There is no service credentials option Or option to create service credentials.
When on the Bluemix dashboard, click on the Blockchain service and then on "service credentials" in the left column. This is where you'll find the credentials, if there isn't any click "create new credentials".