bruceadams / wdscli

Command line interface to the IBM Watson Discovery Service API
MIT License
8 stars 0 forks source link

Update authentication for IAM support #14

Open bberk041 opened 6 years ago

bberk041 commented 6 years ago

My understanding of this so far is that initially <username>:<password> will be replaced with apikey:<apikey>. At some point this will also be replaced with token based authentication which isn't available yet.

mfulgo commented 6 years ago

The work-around for this is fairly easy, though it's a manual tweak.

{
  "discovery": [
    {
      "name": "discovery-testing-discovery-1234567890123",
      "plan": "lite",
      "credentials": {
        "apikey": "<SomeReallyLongApiKey>",
        "iam_apikey_description": "Auto generated apikey <...>",
        "iam_apikey_name": "auto-generated-apikey-<uuid>",
        "iam_role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
        "iam_serviceid_crn": "crn:v1:<...>",
        "url": "https://gateway.watsonplatform.net/discovery/api"
      }
    }
  ]
}

To get things working, tweak the above json to the following:

{
  "username": "apikey",
  "password": "<SomeReallyLongApiKey>",
  "url": "https://gateway.watsonplatform.net/discovery/api"
}