alibabacloud-credentials
The alibabacloud credentials module of alibabaCloud Python SDK.
Description
English | [įŽäŊ䏿](README-CN.md)  # Alibaba Cloud Credentials for Python [](https://badge.fury.io/py/alibabacloud_credentials) [](https://github.com/aliyun/credentials-python/actions/workflows/testPython.yml) [](https://codecov.io/gh/aliyun/credentials-python) ## Important Updates - Starting from version 1.0rc1, the package `alibabacloud-credentials` only supports Python 3.7 and above. ## Installation - **Install with pip** Python SDK uses a common package management tool named `pip`. If pip is not installed, see the [pip user guide](https://pip.pypa.io/en/stable/installing/ "pip User Guide") to install pip. ```bash # Install the alibabacloud-credentials pip install alibabacloud-credentials ``` ## Usage Before you begin, you need to sign up for an Alibaba Cloud account and retrieve your [Credentials](https://usercenter.console.aliyun.com/#/manage/ak). ### **Parameters** of the **Credentials tool** ----------------------------------------------------------- The parameters of the Credentials tool are defined in the `Config` class of the `alibabacloud_credentials.models` module. The credential type is determined by the value of `type`, which is a required parameter in the configurations. After you determine a credential type, configure parameters based on the credential type. The following table describes the valid values of `type` and the parameters supported by each credential type. In the table, a check mark (`â`) indicates that the parameter is required, a hyphen (`-`) indicates that the parameter is optional, and an X mark (`Ã`) indicates that the parameter is not supported. **Note** We recommend that you do not use parameters that are not listed in the following table. | **type** | **access_key** | **sts** | **ram_role_arn** | **ecs_ram_role** | **oidc_role_arn** | **credentials_uri** | **bearer** | | --- | --- | ---- | --- | --- | --- | --- | --- | | access_key_id: the AccessKey ID. | â | â | â | à | à | à | à | | access_key_secret: the AccessKey secret. | â | â | â | à | à | à | à | | security_token: Security Token Service (STS) token. | à | â | - | à | à | à | à | | role_arn: the Alibaba Cloud Resource Name (ARN) of the Resource Access Management (RAM) role. | à | à | â | à | â | à | à | | role_session_name: the name of the custom session. The default format is `credentials-java-The current timestamp`. | à | à | - | à | - | à | à | | role_name: specifies the name of the RAM role. | à | à | à | - | à | à | à | | disable_imds_v1: specifies whether to forcibly use the security hardening mode (IMDSv2). If you set this parameter to true, the security hardening mode (IMDSv2) is used. Default value: `false`. | à | à | à | - | à | à | à | | bearer_token: a bearer token. | à | à | à | à | Ã
Release History
| Version | Changes | Urgency | Date |
|---|---|---|---|
| 1.0.8 | Imported from PyPI (1.0.8) | Low | 4/21/2026 |
| v1.0.8 | ## What's Changed * feat: support oauth credential without refresh token by @yndu13 in https://github.com/aliyun/credentials-python/pull/81 **Full Changelog**: https://github.com/aliyun/credentials-python/compare/v1.0.7...v1.0.8 | Low | 3/11/2026 |
| v1.0.7 | ## What's Changed * fix: increase OAuth token refresh lead time to prevent exchange failure by @yndu13 in https://github.com/aliyun/credentials-python/pull/79 **Full Changelog**: https://github.com/aliyun/credentials-python/compare/v1.0.6...v1.0.7 | Low | 1/27/2026 |
| v1.0.6 | ## What's Changed * When using ChainableRamRoleArn profile and Oauth updated tokens are not saved to correct profile by @frco9 in https://github.com/aliyun/credentials-python/pull/75 * fix: update OAuth token when has source profile by @yndu13 in https://github.com/aliyun/credentials-python/pull/76 * fix: rm :=, support py3.7 by @TsinghuaDream in https://github.com/aliyun/credentials-python/pull/78 ## New Contributors * @frco9 made their first contribution in https://github.com/aliyun/cr | Low | 1/26/2026 |
| v1.0.4 | ## What's Changed * docs: update README && update logger level by @yndu13 in https://github.com/aliyun/credentials-python/pull/69 * feat: support CloudSSO & OAuth credentials provider by @yndu13 in https://github.com/aliyun/credentials-python/pull/70 * remove debug log statement in EXECUTOR shutdown callback by @psnelgrove-r7 in https://github.com/aliyun/credentials-python/pull/72 ## New Contributors * @psnelgrove-r7 made their first contribution in https://github.com/aliyun/credentials-p | Low | 12/5/2025 |
| v1.0.2 | ## What's Changed * refactor credentials providers by @yndu13 in https://github.com/aliyun/credentials-python/pull/50 * fix: update profiles path by @yndu13 in https://github.com/aliyun/credentials-python/pull/51 * fix: raise error when profile name not exist by @yndu13 in https://github.com/aliyun/credentials-python/pull/52 * fix: remove risky internal function calls by @yndu13 in https://github.com/aliyun/credentials-python/pull/54 * feat: support StsToken mode in cli profile by @yndu13 i | Low | 10/9/2025 |
| v1.0rc3 | ## What's Changed * fix: raise error when profile name not exist by @yndu13 in https://github.com/aliyun/credentials-python/pull/52 **Full Changelog**: https://github.com/aliyun/credentials-python/compare/v1.0rc2...v1.0rc3 | Low | 2/28/2025 |
| v1.0rc2 | ## What's Changed * fix: update profiles path by @yndu13 in https://github.com/aliyun/credentials-python/pull/51 **Full Changelog**: https://github.com/aliyun/credentials-python/compare/v1.0rc1...v1.0rc2 | Low | 2/28/2025 |
| v1.0rc1 | ## What's Changed * refactor credentials providers by @yndu13 in https://github.com/aliyun/credentials-python/pull/50 **Full Changelog**: https://github.com/aliyun/credentials-python/compare/v0.3.6...v1.0rc1 | Low | 2/19/2025 |
| v0.3.6 | ## What's Changed * update usage document by @Orisdaddy in https://github.com/aliyun/credentials-python/pull/1 * Fix home path by @Orisdaddy in https://github.com/aliyun/credentials-python/pull/2 * Release version 0.0.2 by @Orisdaddy in https://github.com/aliyun/credentials-python/pull/3 * Change long description content type by @Orisdaddy in https://github.com/aliyun/credentials-python/pull/4 * Support python 3.4 by @Orisdaddy in https://github.com/aliyun/credentials-python/pull/5 * Relea | Low | 2/19/2025 |
