You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/08/14 09:32:35 UTC

[GitHub] jthomas commented on a change in pull request #129: Iam enablement

jthomas commented on a change in pull request #129: Iam enablement
URL: https://github.com/apache/incubator-openwhisk-client-js/pull/129#discussion_r209885724
 
 

 ##########
 File path: README.md
 ##########
 @@ -64,6 +64,41 @@ var ow = openwhisk(options);
 ow.actions.invoke('sample').then(result => console.log(result))
 ```
 
+### Using 3rd party Authentication Handler
+You can specify an authentication handler in `options.authHandler` this is a an object that provides a function `getAuthHeader` that returns a Promise or String to be used in the `Authorization` header for every http request.
+```javascript
+const authHandler = {
+  getAuthHeader: ()=>{
+    return Promise.resolve('Basic user:password')
+  }
+}
+var openwhisk = require('openwhisk');
+var options = {
+                 apihost: 'openwhisk.ng.bluemix.net',
+                 authHandler: authHandler
+              }
+var ow = openwhisk(options)
+ow.actions.invoke('sample').then(result => console.log(result))
+``` 
+
+### Example Using a Authentication Handler with IBM IAM
 
 Review comment:
   Open-source OpenWhisk project documentation does not need to contain provider specific information? This should go in provider documentation instead. Can we remove this section?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services