Skip to content

Commit 4e00fe7

Browse files
cloudant-sdks-automationricellis
authored andcommitted
docs(generated): update auth information
Generated SDK source code using: - Generator version 3.105.1 - Specification version 1.0.0-dev0.1.28 - Automation (cloudant-sdks) version 0e9362b
1 parent 7eeeba0 commit 4e00fe7

File tree

1 file changed

+36
-24
lines changed

1 file changed

+36
-24
lines changed

README.md

Lines changed: 36 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ to avoid surprises.
3131
- [IAM API key authentication](#iam-api-key-authentication)
3232
- [IAM Trusted profile (container) authentication](#iam-trusted-profile-container-authentication)
3333
- [IAM Trusted profile (VPC) authentication](#iam-trusted-profile-vpc-authentication)
34+
- [IAM Trusted profile (assume identity) authentication](#iam-trusted-profile-assume-identity-authentication)
3435
- [Session cookie authentication](#session-cookie-authentication)
3536
+ [Authentication with external configuration](#authentication-with-external-configuration)
3637
+ [Programmatic authentication](#programmatic-authentication)
@@ -176,47 +177,41 @@ Examples for other configuration methods are available by following the provided
176177

177178

178179
This library requires credentials to authenticate with IBM Cloudant. These credentials may be:
179-
* IBM Cloud IAM credentials (can be used with authentication types `CONTAINER`, `VPC` and `IAM`)
180+
* IBM Cloud IAM credentials (with authentication types `CONTAINER`, `VPC`, `IAMASSUME` and `IAM`)
180181
* [IBM Cloud account](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-managing-access-for-cloudant#introduction-iam-ai) user, service ID or trusted profile credentials
181-
that have been granted access to the IBM Cloud Cloudant resource instance.
182+
that have access granted to the IBM Cloud Cloudant resource instance.
182183
* [IBM Cloudant service credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-locating-your-service-credentials) generated by the IBM Cloud Cloudant resource instance.
183-
* Username and password credentials (can be used with authentication types `COUCHDB_SESSION` and `BASIC`)
184+
* Username and password credentials (with authentication types `COUCHDB_SESSION` and `BASIC`)
184185
* [IBM Cloudant service credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-locating-your-service-credentials) generated for an IBM Cloud Cloudant resource instance not configured as `IAM only`.
185-
* IBM Cloudant [legacy credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-work-with-your-account#basic-authentication) (i.e. username and password) for instances not in IBM Cloud.
186+
* IBM Cloudant [legacy credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-work-with-your-account#basic-authentication) (username and password) for instances not in IBM Cloud.
186187
* IBM Cloudant [legacy API keys](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-work-with-your-account#api-keys).
187188

188-
For other compatible APIs that are not Cloudant accounts (e.g. Apache CouchDB) non-IAM based authentication types
189-
must be used.
190-
191-
This table summarizes the available authentication types.
192-
The authentication types are listed in order of recommendation, preferably use the authentication type
193-
from the first row in the table that is compatible with your environment.
194-
195189
| Authentication type | Recommended for | `AUTH_TYPE` | Description |
196190
| --- | --- | --- | --- |
197-
| IAM Trusted Profiles compute resource ([container](https://github.com/IBM/java-sdk-core/blob/main/Authentication.md#container-authentication)) | Cloudant<BR>(SDK running in IBM Cloud IKS) | `CONTAINER` | Obtains a compute resource (CR) token from the container.<BR>Exchanges the CR token for an IAM `access_token`.<BR>Adds an `Authorization: Bearer <access_token>` header to each HTTP request.<BR>Automatically renews the access token when needed. |
198-
| IAM Trusted Profiles compute resource ([VPC](https://github.com/IBM/java-sdk-core/blob/main/Authentication.md#vpc-instance-authentication)) | Cloudant<BR>(SDK running in IBM Cloud VPC) | `VPC` | Obtains an identity token from the VPC instance metadata.<BR>Exchanges the identity token for an IAM `access_token`.<BR>Adds an `Authorization: Bearer <access_token>` header to each HTTP request.<BR>Automatically renews the access token when needed. |
199-
| [IAM API key](https://github.com/IBM/java-sdk-core/blob/main/Authentication.md#identity-and-access-management-iam-authentication) | Cloudant | `IAM` | Exchanges an IAM API key for an IAM `access_token`.<BR>Adds an `Authorization: Bearer <access_token>` header to each HTTP request.<BR>Automatically renews the access token when needed. |
191+
| IAM Trusted Profiles (compute resource [container](https://github.com/IBM/java-sdk-core/blob/main/Authentication.md#container-authentication)) | Cloudant<BR>(SDK running in IBM Cloud IKS) | `CONTAINER` | Obtains a compute resource (CR) token from the container.<BR>Exchanges the CR token for an IAM `access_token`.<BR>Adds an `Authorization: Bearer <access_token>` header to each HTTP request.<BR>Automatically renews the access token when needed. |
192+
| IAM Trusted Profiles (compute resource [VPC](https://github.com/IBM/java-sdk-core/blob/main/Authentication.md#vpc-instance-authentication)) | Cloudant<BR>(SDK running in IBM Cloud VPC) | `VPC` | Obtains an identity token from the VPC instance metadata.<BR>Exchanges the identity token for an IAM `access_token`.<BR>Adds an `Authorization: Bearer <access_token>` header to each HTTP request.<BR>Automatically renews the access token when needed. |
193+
| IAM Trusted Profiles ([assume identity](https://github.com/IBM/java-sdk-core/blob/main/Authentication.md#identity-and-access-management-iam-authentication-grant-type-assume)) | Cloudant | `IAMASSUME` | Exchanges an IAM API key for an IAM `access_token` (same as `IAM` auth type).<BR>Uses that initial token to obtain a second `access_token` from IAM with the assumed identity information.<BR>Adds an `Authorization: Bearer <access_token>` header to each HTTP request.<BR>Automatically renews the access token when needed. |
194+
| [IAM API key](https://github.com/IBM/java-sdk-core/blob/main/Authentication.md#identity-and-access-management-iam-authentication-grant-type-apikey) | Cloudant | `IAM` | Exchanges an IAM API key for an IAM `access_token`.<BR>Adds an `Authorization: Bearer <access_token>` header to each HTTP request.<BR>Automatically renews the access token when needed. |
200195
| [Session cookie](#session-cookie-authentication) | [Cloudant](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-work-with-your-account#cookie-authentication)<BR>(legacy credentials & instances without IAM)<BR><BR>[Apache CouchDB](https://docs.couchdb.org/en/stable/api/server/authn.html#cookie-authentication) | `COUCHDB_SESSION` | Exchanges credentials with `/_session` endpoint to retrieve a cookie.<BR>Adds `Cookie` header and content to each HTTP request.<BR>Automatically renews session when needed. |
201196
| [Bearer token](https://github.com/IBM/java-sdk-core/blob/main/Authentication.md#bearer-token-authentication) | [Apache CouchDB](https://docs.couchdb.org/en/stable/api/server/authn.html#jwt-authentication)<BR>(using JWT authentication) | `BEARERTOKEN` | Adds an `Authorization: Bearer <token>` to each HTTP request.<BR>No token management or renewal.<BR>Also compatible with IAM access tokens managed independently of the SDK. |
202197
| [Basic](https://github.com/IBM/java-sdk-core/blob/main/Authentication.md#basic-authentication) | [Apache CouchDB](https://docs.couchdb.org/en/stable/api/server/authn.html#basic-authentication)<BR>(if cookies are not enabled) | `BASIC` | Adds an `Authorization: Basic <encoded username and password>` header to each HTTP request. |
203198
| [None](https://github.com/IBM/java-sdk-core/blob/main/Authentication.md#no-auth-authentication) | - | `NOAUTH` | Note that this authentication type only works for operations against a database allowing access for unauthenticated users. |
204199

205-
The default authentication type for the SDK is `CONTAINER` unless `APIKEY` configuration is supplied, which changes the default authentication type to `IAM`.
200+
The default authentication type for the SDK is `CONTAINER` unless supplying `APIKEY` configuration, which changes the default authentication type to `IAM`.
206201

207202
#### Authentication with environment variables
208203

209-
The default service name is `CLOUDANT` so `CLOUDANT_` prefixed names are used in these examples.
204+
The default service name is `CLOUDANT` so these examples use `CLOUDANT_` prefixed names.
210205

211-
Any custom service name prefix can be used as long as the matching name is used to instantiate the SDK client
212-
and the same prefix is used for all configuration options.
206+
Any custom service name prefix is valid, provided it matches the name used to instantiate the SDK client
207+
and applied to all configuration options.
213208

214209
##### IAM API key authentication
215210

216211
For Cloudant *IAM API key authentication*, set the following environmental variables by
217212
replacing the `<url>` and `<apikey>` with your proper
218213
[service credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-locating-your-service-credentials). There is no need to set
219-
`CLOUDANT_AUTH_TYPE` to `IAM` because it is the default when an `APIKEY` is set.
214+
`CLOUDANT_AUTH_TYPE` to `IAM` because it is the default when supplying an `APIKEY`.
220215

221216
```bash
222217
CLOUDANT_URL=<url>
@@ -234,7 +229,8 @@ CLOUDANT_URL=<url>
234229
CLOUDANT_IAM_PROFILE_ID=<id>
235230
```
236231

237-
Alternatively a profile name may be used instead of an ID by replacing `CLOUDANT_IAM_PROFILE_ID` with `CLOUDANT_IAM_PROFILE_NAME`.
232+
Alternatives to `CLOUDANT_IAM_PROFILE_ID`:
233+
* `CLOUDANT_IAM_PROFILE_NAME`
238234

239235
##### IAM Trusted profile (VPC) authentication
240236

@@ -247,7 +243,24 @@ CLOUDANT_URL=<url>
247243
CLOUDANT_IAM_PROFILE_ID=<id>
248244
```
249245

250-
Alternatively a profile CRN may be used instead of an ID by replacing `CLOUDANT_IAM_PROFILE_ID` with `CLOUDANT_IAM_PROFILE_CRN`.
246+
Alternatives to `CLOUDANT_IAM_PROFILE_ID`:
247+
* `CLOUDANT_IAM_PROFILE_CRN`
248+
* No profile information (uses the default trusted profile linked to the compute resource)
249+
250+
##### IAM Trusted profile (assume identity) authentication
251+
252+
For Cloudant *IAM Trusted profile assume authentication*, set the following environmental variables by
253+
replacing the `<url>` and `<id>` with your values.
254+
255+
```bash
256+
CLOUDANT_AUTH_TYPE=IAMASSUME
257+
CLOUDANT_URL=<url>
258+
CLOUDANT_IAM_PROFILE_ID=<id>
259+
```
260+
261+
Alternatives to `CLOUDANT_IAM_PROFILE_ID`:
262+
* `CLOUDANT_IAM_PROFILE_CRN`
263+
* `CLOUDANT_IAM_PROFILE_NAME` *and* `CLOUDANT_IAM_ACCOUNT_ID` (ID of the account that contains the named trusted profile)
251264

252265
##### Session cookie authentication
253266

@@ -264,11 +277,10 @@ CLOUDANT_PASSWORD=<password>
264277

265278
#### Authentication with external configuration
266279

267-
To use an external configuration file, the
280+
For more information about using an external configuration file, see the related documentation in
268281
[Cloudant API docs](https://cloud.ibm.com/apidocs/cloudant?code=java#authentication-with-external-configuration),
269282
or the
270-
[general SDK usage information](https://github.com/IBM/ibm-cloud-sdk-common#using-external-configuration)
271-
will guide you.
283+
[general SDK usage information](https://github.com/IBM/ibm-cloud-sdk-common#using-external-configuration).
272284

273285
#### Programmatic authentication
274286

0 commit comments

Comments
 (0)