# alibabacloud-credentials

> The alibabacloud credentials module of alibabaCloud Python SDK.

- **URL**: https://www.freshcrate.ai/projects/alibabacloud-credentials
- **Author**: Alibaba Cloud
- **Category**: Frameworks
- **Latest version**: `1.0.8` (2026-04-21)
- **License**: Apache License 2.0
- **Source**: https://github.com/aliyun/credentials-python
- **Language**: Python
- **GitHub**: 9 stars, 12 forks
- **Registry**: pypi (`alibabacloud-credentials`)
- **Tags**: `alibabacloud`, `pypi`, `sdk`, `tea`

## Description

English | [简体中文](README-CN.md)

![Alibaba Cloud Logo](https://aliyunsdk-pages.alicdn.com/icons/AlibabaCloud.svg)

# Alibaba Cloud Credentials for Python

[![PyPI version](https://badge.fury.io/py/alibabacloud_credentials.svg)](https://badge.fury.io/py/alibabacloud_credentials)
[![Python Test](https://github.com/aliyun/credentials-python/actions/workflows/testPython.yml/badge.svg)](https://github.com/aliyun/credentials-python/actions/workflows/testPython.yml)
[![codecov](https://codecov.io/gh/aliyun/credentials-python/graph/badge.svg?token=Y0J1E7T35I)](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.                                                                                                                                                                                                         | ×              | ×       | ×                | ×                | ×

## Recent releases

| Version | Date | Urgency | Changes |
| --- | --- | --- | --- |
| `1.0.8` | 2026-04-21 | Low | Imported from PyPI (1.0.8) |
| `v1.0.8` | 2026-03-11 | Low | ## 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 |
| `v1.0.8` | 2026-03-11 | Low | ## 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 |
| `v1.0.8` | 2026-03-11 | Low | ## 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 |
| `v1.0.8` | 2026-03-11 | Low | ## 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 |
| `v1.0.8` | 2026-03-11 | Low | ## 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 |
| `v1.0.8` | 2026-03-11 | Low | ## 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 |
| `v1.0.8` | 2026-03-11 | Low | ## 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 |
| `v1.0.8` | 2026-03-11 | Low | ## 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 |
| `v1.0.8` | 2026-03-11 | Low | ## 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 |

## Dependency audit

- **Score**: 98/100
- **Total deps**: 0
- **Resolved**: 0
- **Unresolved**: 0
- **License conflicts**: 0
- **Warnings**: 1
- **Scanned**: 2026-05-18

## Citation

- HTML: https://www.freshcrate.ai/projects/alibabacloud-credentials
- Markdown: https://www.freshcrate.ai/projects/alibabacloud-credentials.md
- Dependencies JSON: https://www.freshcrate.ai/api/projects/alibabacloud-credentials/deps

_Generated by freshcrate.ai. Indexes pypi releases for AI-agent ecosystem packages._
