Skip to content

Commit 820ed31

Browse files
committed
docs: add deprecation message for using watson-tokens
1 parent 41dda05 commit 820ed31

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@ The Authorization service can generate auth tokens for situations where providin
239239

240240
Tokens are valid for 1 hour and may be sent using the `X-Watson-Authorization-Token` header or the `watson-token` query param.
241241

242+
> _NOTE_: Authenticating with the `X-Watson-Authorization-Token` header is now deprecated. The token continues to work with Cloud Foundry services, but is not supported for services that use Identity and Access Management (IAM) authentication. For details see [Authenticating with IAM tokens](https://console.bluemix.net/docs/services/watson/getting-started-iam.html#iam) or the README in the IBM Watson SDK you use.
243+
242244
Note that the token is supplied URL-encoded, and will not be accepted if it is double-encoded in a querystring.
243245

244246
```javascript

lib/recognize-stream.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,12 @@ class RecognizeStream extends Duplex {
181181
const options = this.options;
182182

183183
if (options.token && !options['watson-token']) {
184+
console.warn(
185+
'Authenticating with the X-Watson-Authorization-Token header is deprecated.' +
186+
' The token continues to work with Cloud Foundry services, but is not' +
187+
' supported for services that use Identity and Access Management (IAM) authentication.' +
188+
' For details see Authenticating with IAM tokens or the README in the IBM Watson SDK you use.'
189+
);
184190
options['watson-token'] = options.token;
185191
}
186192
if (options.content_type && !options['content-type']) {

0 commit comments

Comments
 (0)