You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -141,47 +142,41 @@ Examples for other configuration methods are available by following the provided
141
142
142
143
143
144
This library requires credentials to authenticate with IBM Cloudant. These credentials may be:
144
-
* IBM Cloud IAM credentials (can be used with authentication types `CONTAINER`, `VPC` and `IAM`)
145
+
* IBM Cloud IAM credentials (with authentication types `CONTAINER`, `VPC`, `IAMASSUME` and `IAM`)
145
146
*[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
146
-
that have been granted access to the IBM Cloud Cloudant resource instance.
147
+
that have access granted to the IBM Cloud Cloudant resource instance.
147
148
*[IBM Cloudant service credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-locating-your-service-credentials) generated by the IBM Cloud Cloudant resource instance.
148
-
* Username and password credentials (can be used with authentication types `COUCHDB_SESSION` and `BASIC`)
149
+
* Username and password credentials (with authentication types `COUCHDB_SESSION` and `BASIC`)
149
150
*[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`.
150
-
* 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.
151
+
* 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.
151
152
* IBM Cloudant [legacy API keys](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-work-with-your-account#api-keys).
152
153
153
-
For other compatible APIs that are not Cloudant accounts (e.g. Apache CouchDB) non-IAM based authentication types
154
-
must be used.
155
-
156
-
This table summarizes the available authentication types.
157
-
The authentication types are listed in order of recommendation, preferably use the authentication type
158
-
from the first row in the table that is compatible with your environment.
159
-
160
154
| Authentication type | Recommended for |`AUTH_TYPE`| Description |
161
155
| --- | --- | --- | --- |
162
-
| IAM Trusted Profiles compute resource ([container](https://github.com/IBM/python-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. |
163
-
| IAM Trusted Profiles compute resource ([VPC](https://github.com/IBM/python-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. |
164
-
|[IAM API key](https://github.com/IBM/python-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. |
156
+
| IAM Trusted Profiles (compute resource [container](https://github.com/IBM/python-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. |
157
+
| IAM Trusted Profiles (compute resource [VPC](https://github.com/IBM/python-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. |
158
+
| IAM Trusted Profiles ([assume identity](https://github.com/IBM/python-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. |
159
+
|[IAM API key](https://github.com/IBM/python-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. |
165
160
|[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. |
166
161
|[Bearer token](https://github.com/IBM/python-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. |
167
162
|[Basic](https://github.com/IBM/python-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. |
168
163
|[None](https://github.com/IBM/python-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. |
169
164
170
-
The default authentication type for the SDK is `CONTAINER` unless `APIKEY` configuration is supplied, which changes the default authentication type to `IAM`.
165
+
The default authentication type for the SDK is `CONTAINER` unless supplying `APIKEY` configuration, which changes the default authentication type to `IAM`.
171
166
172
167
#### Authentication with environment variables
173
168
174
-
The default service name is `CLOUDANT` so `CLOUDANT_` prefixed names are used in these examples.
169
+
The default service name is `CLOUDANT` so these examples use `CLOUDANT_` prefixed names.
175
170
176
-
Any custom service name prefix can be used as long as the matching name is used to instantiate the SDK client
177
-
and the same prefix is used for all configuration options.
171
+
Any custom service name prefix is valid, provided it matches the name used to instantiate the SDK client
172
+
and applied to all configuration options.
178
173
179
174
##### IAM API key authentication
180
175
181
176
For Cloudant *IAM API key authentication*, set the following environmental variables by
182
177
replacing the `<url>` and `<apikey>` with your proper
183
178
[service credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-locating-your-service-credentials). There is no need to set
184
-
`CLOUDANT_AUTH_TYPE` to `IAM` because it is the default when an `APIKEY` is set.
179
+
`CLOUDANT_AUTH_TYPE` to `IAM` because it is the default when supplying an `APIKEY`.
185
180
186
181
```bash
187
182
CLOUDANT_URL=<url>
@@ -199,7 +194,8 @@ CLOUDANT_URL=<url>
199
194
CLOUDANT_IAM_PROFILE_ID=<id>
200
195
```
201
196
202
-
Alternatively a profile name may be used instead of an ID by replacing `CLOUDANT_IAM_PROFILE_ID` with `CLOUDANT_IAM_PROFILE_NAME`.
197
+
Alternatives to `CLOUDANT_IAM_PROFILE_ID`:
198
+
*`CLOUDANT_IAM_PROFILE_NAME`
203
199
204
200
##### IAM Trusted profile (VPC) authentication
205
201
@@ -212,7 +208,24 @@ CLOUDANT_URL=<url>
212
208
CLOUDANT_IAM_PROFILE_ID=<id>
213
209
```
214
210
215
-
Alternatively a profile CRN may be used instead of an ID by replacing `CLOUDANT_IAM_PROFILE_ID` with `CLOUDANT_IAM_PROFILE_CRN`.
211
+
Alternatives to `CLOUDANT_IAM_PROFILE_ID`:
212
+
*`CLOUDANT_IAM_PROFILE_CRN`
213
+
* No profile information (uses the default trusted profile linked to the compute resource)
214
+
215
+
##### IAM Trusted profile (assume identity) authentication
216
+
217
+
For Cloudant *IAM Trusted profile assume authentication*, set the following environmental variables by
218
+
replacing the `<url>` and `<id>` with your values.
219
+
220
+
```bash
221
+
CLOUDANT_AUTH_TYPE=IAMASSUME
222
+
CLOUDANT_URL=<url>
223
+
CLOUDANT_IAM_PROFILE_ID=<id>
224
+
```
225
+
226
+
Alternatives to `CLOUDANT_IAM_PROFILE_ID`:
227
+
*`CLOUDANT_IAM_PROFILE_CRN`
228
+
*`CLOUDANT_IAM_PROFILE_NAME`*and*`CLOUDANT_IAM_ACCOUNT_ID` (ID of the account that contains the named trusted profile)
0 commit comments