Skip to main content

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

Project description

cloud-idaas-core-alibabacloud-authentication-plugin

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": {
        "authenticationSubject": "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": {
        "authenticationSubject": "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": {
        "authenticationSubject": "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.1b0.tar.gz.

File metadata

File hashes

Hashes for cloud_idaas_core_alibabacloud_authentication_plugin-0.0.1b0.tar.gz
Algorithm Hash digest
SHA256 4779df74c05694c3a5d35167df39d86973d9b38a1411e884e75b792a974c8ca1
MD5 f0d7acf4a1d43fb5d1cf6c03984e6f9d
BLAKE2b-256 eae13ee1b1293fdb3400e2556b5f4564ffa3d7e6781cda296dfa5bea014b125b

See more details on using hashes here.

Provenance

The following attestation bundles were made for cloud_idaas_core_alibabacloud_authentication_plugin-0.0.1b0.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.1b0-py3-none-any.whl.

File metadata

File hashes

Hashes for cloud_idaas_core_alibabacloud_authentication_plugin-0.0.1b0-py3-none-any.whl
Algorithm Hash digest
SHA256 940402560d77143570a8395d0d1d4c3f030404472124f426d19d5ebdda7ed33d
MD5 aa9f5059c63f78a5aa554e4a7e55070a
BLAKE2b-256 da623c86b7f919de957be626488bbdc3e41dc0b4ab1c4a8e0bf3be02d68e51b1

See more details on using hashes here.

Provenance

The following attestation bundles were made for cloud_idaas_core_alibabacloud_authentication_plugin-0.0.1b0-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