user1456110
user1456110

Reputation: 89

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?

Upvotes: 0

Views: 1431

Answers (2)

Dr G.
Dr G.

Reputation: 1332

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>'
};

Upvotes: 0

Memo Cabrera
Memo Cabrera

Reputation: 46

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]:

  1. Navigate to your Cloud Object storage account
  2. Click on right under Service credentials
  3. Click New credentials button on right
  4. 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

Upvotes: 1

Related Questions