Skip to main content

Authentication plugin for IDaaS (Identity as a Service) core sdk

Project description

cloud-idaas-core-alibabacloud-authentication-plugin

简体中文 | English

Python Version License Development Status

Authentication plugin for IDaaS (Identity as a Service) core SDK, providing Alibaba Cloud EIAM integration for machine-to-machine authentication.

Features

  • Alibaba Cloud EIAM Integration: Seamlessly integrates with Alibaba Cloud EIAM service for OAuth2 token generation
  • Plugin Architecture: Implements the PluginCredentialProvider interface from cloud-idaas-core
  • Automatic Registration: Auto-registers as a plugin via entry points configuration

Requirements

  • Python >= 3.9
  • Dependencies:
    • cloud-idaas-core >= 0.0.2b0
    • alibabacloud_eiam20211201 >= 2.13.2

Installation

pip install cloud-idaas-core-alibabacloud-authentication-plugin

Quick Start

1. Configuration File

Create a configuration file ~/.cloud_idaas/client_config.json:

{
    "idaasInstanceId": "your-idaas-instance-id",
    "clientId": "your-client-id",
    "issuer": "your-idaas-issuer-url",
    "tokenEndpoint": "your-idaas-token-endpoint",
    "scope": "your-requested-scope",
    "openApiEndpoint": "eiam.[region_id].aliyuncs.com",
    "authnConfiguration": {
        "identityType": "CLIENT",
        "authnMethod": "PLUGIN",
        "pluginName": "alibabacloudPluginCredentialProvider"
    }
}

2. Use in code

from cloud_idaas.core import IDaaSCredentialProviderFactory

# Initialize (automatically loads configuration file)
IDaaSCredentialProviderFactory.init()

# Get credential provider
credential_provider = IDaaSCredentialProviderFactory.get_idaas_credential_provider()

# Get access token
access_token = credential_provider.get_bearer_token()
print(f"Access Token: {access_token}")

Configuration Details

Complete Configuration Example

{
    "idaasInstanceId": "idaas_xxx",
    "clientId": "app_xxx",
    "issuer": "https://xxx/api/v2/iauths_system/oauth2",
    "tokenEndpoint": "https://xxx/api/v2/iauths_system/oauth2/token",
    "scope": "api.example.com|read:file",
    "openApiEndpoint": "eiam.[region_id].aliyuncs.com",
    "authnConfiguration": {
        "identityType": "CLIENT",
        "authnMethod": "PLUGIN",
        "pluginName": "alibabacloudPluginCredentialProvider"
    },
    "httpConfiguration": {
        "connectTimeout": 5000,
        "readTimeout": 10000
    }
}

Configuration Items

Configuration Item Type Required Description
idaasInstanceId string Yes IDaaS instance ID
clientId string Yes Client ID for authentication
issuer string Yes OAuth2 issuer URL
tokenEndpoint string Yes OAuth2 token endpoint URL
scope string No Requested scope
openApiEndpoint string Yes Alibaba Cloud EIAM OpenAPI endpoint
authnConfiguration object Yes Authentication configuration
httpConfiguration object No HTTP client configuration

Plugin Configuration

To use this plugin, set the authnMethod to PLUGIN and specify the plugin name:

{
    "authnConfiguration": {
        "identityType": "CLIENT",
        "authnMethod": "PLUGIN",
        "pluginName": "alibabacloudPluginCredentialProvider"
    }
}

Support and Feedback

License

This project is licensed under the Apache License 2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file cloud_idaas_core_alibabacloud_authentication_plugin-0.0.1b1.tar.gz.

File metadata

File hashes

Hashes for cloud_idaas_core_alibabacloud_authentication_plugin-0.0.1b1.tar.gz
Algorithm Hash digest
SHA256 89d62b560f445bde368149d37186cdc181f5f640170fc111b8fd6c090bdf3f01
MD5 1dd36dee5c26599d6981ca04c7222be4
BLAKE2b-256 5e6aae9edbe63e18635db94d49ab70ec42e303ed9e4341a175225e8e488bafb4

See more details on using hashes here.

Provenance

The following attestation bundles were made for cloud_idaas_core_alibabacloud_authentication_plugin-0.0.1b1.tar.gz:

Publisher: publish.yml on cloud-idaas/idaas-python-core-alibabacloud-authentication-plugin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cloud_idaas_core_alibabacloud_authentication_plugin-0.0.1b1-py3-none-any.whl.

File metadata

File hashes

Hashes for cloud_idaas_core_alibabacloud_authentication_plugin-0.0.1b1-py3-none-any.whl
Algorithm Hash digest
SHA256 b47427b1ffb658449ec369bcd807d0007d24dee5f64886baa2e360336497e486
MD5 9987d1807b493c775e8d90431aeed02a
BLAKE2b-256 27a5a7ffcdcbb440cdef74aaeb5218025db86f8e4494b249cc74b5fd51375352

See more details on using hashes here.

Provenance

The following attestation bundles were made for cloud_idaas_core_alibabacloud_authentication_plugin-0.0.1b1-py3-none-any.whl:

Publisher: publish.yml on cloud-idaas/idaas-python-core-alibabacloud-authentication-plugin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page