Skip to content

Commit 31c42de

Browse files
committed
docs(main README): Address review comments
1 parent 6f80223 commit 31c42de

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,17 @@ service.setApiKey("<api_key>");
170170

171171
### Using IAM
172172

173-
When authenticating with IAM, you have the option of passing in the IAM API key, the IAM URL, and an IAM access token. **Be aware that passing in an access token means that you're assuming responsibility for maintaining that token's lifecycle.** If you instead pass in an IAM API key, the SDK will manage it for you.
173+
When authenticating with IAM, you have the option of passing in:
174+
- the IAM API key and, optionally, the IAM service URL
175+
- an IAM access token
176+
177+
**Be aware that passing in an access token means that you're assuming responsibility for maintaining that token's lifecycle.** If you instead pass in an IAM API key, the SDK will manage it for you.
174178

175179
```java
176180
// in the constructor, letting the SDK manage the IAM token
177181
IamOptions options = new IamOptions.Builder()
178182
.apiKey("<iam_api_key>")
179-
.url("<iam_url>")
183+
.url("<iam_url>") // optional - the default value is https://iam.ng.bluemix.net/identity/token
180184
.build();
181185
Discovery service = new Discovery("2017-11-07", options);
182186
```
@@ -186,26 +190,23 @@ Discovery service = new Discovery("2017-11-07", options);
186190
Discovery service = new Discovery("2017-11-07");
187191
IamOptions options = new IamOptions.Builder()
188192
.apiKey("<iam_api_key>")
189-
.url("<iam_url>")
190193
.build();
191194
service.setIamCredentials(options);
192195
```
193196

194197
```java
195-
// in the constructor, taking control of managing IAM token
198+
// in the constructor, assuming control of managing IAM token
196199
IamOptions options = new IamOptions.Builder()
197200
.accessToken("<access_token>")
198-
.url("<iam_url>")
199201
.build();
200202
Discovery service = new Discovery("2017-11-07", options);
201203
```
202204

203205
```java
204-
// after instantiation, taking control of managing IAM token
206+
// after instantiation, assuming control of managing IAM token
205207
Discovery service = new Discovery("2017-11-07");
206208
IamOptions options = new IamOptions.Builder()
207209
.accessToken("<access_token>")
208-
.url("<iam_url>")
209210
.build();
210211
service.setIamCredentials(options);
211212
```

0 commit comments

Comments
 (0)