El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
Software Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Obtaining a Temporary AK/SK

Updated on 2022-08-16 GMT+08:00

Function

You can obtain a temporary AK/SK and security token (offline AK/SK) by using a user token, agency token, and federated token. A temporary AK/SK is a token with temporary permissions issued to users. It conforms to the principle of least privilege and can be used to temporarily access OBS.

URI

POST /v3.0/OS-CREDENTIAL/securitytokens

Request Parameters

  • Parameters in the request header
    • Obtaining a temporary AK/SK with an agency token (methods is set to assume_role)

      Parameter

      Mandatory

      Type

      Description

      X-Auth-Token

      Yes

      String

      Token with permissions of the Agent Operator policy.

      Content-Type

      Yes

      String

      Fill application/json;charset=utf8 in this field.

    • Obtaining a temporary AK/SK with a user token or a federated token (methods is set to token)

      Parameter

      Mandatory

      Type

      Description

      Content-Type

      Yes

      String

      Fill application/json;charset=utf8 in this field.

      X-Auth-Token

      No

      String

      User token or federated token required for obtaining a temporary AK/SK. You need to specify either this parameter or the token ID in the request body. This parameter takes the precedence.

  • Parameters in the request body
    • Obtaining a temporary AK/SK with an agency token (methods is set to assume_role)

      Parameter

      Mandatory

      Type

      Description

      methods

      Yes

      String Array

      Fill assume_role in this field.

      agency_name

      Yes

      String

      Name of the agency created by a delegating party.

      domain_name or domain_id

      Yes

      String

      domain.name: Name of the domain to which the delegating party belongs.

      duration_seconds

      No

      Int

      Validity period (in seconds) of an AK/SK and security token. The value ranges from 15 minutes to 24 hours. The default value is 15 minutes.

      scope

      No

      Object

      AK/SK and security token. If this parameter is left blank, the generated security token does not contain the scope information. You are advised to leave this parameter blank. To set the scope of the temporary AK/SK and security token, specify a project or domain.

      • If this field is set to project, the temporary AK/SK and security token can only be used to access resources in the project of a specified ID or name.
        "scope": {
              "project": {
              "id": "0b95b78b67fa045b38104c12fb..."
              }
            }
      • If this field is set to domain, the temporary AK/SK and security token can be used to access all resources under the domain of a specified ID or name.
        "scope": {
              "domain": {
              "name": " domain A"
              }
            }
    • Obtaining a temporary AK/SK with a user token or a federated token (methods is set to token)

      Parameter

      Mandatory

      Type

      Description

      methods

      Yes

      String Array

      Fill token in this field.

      token

      No

      JSON object

      Common token or federated token required for obtaining a temporary AK/SK. You need to choose either the ID in this object or X-Auth-Token in the request header. X-Auth-Token takes priority over the ID in this object.

      duration_seconds

      No

      Int

      Validity period (in seconds) of an AK/SK and security token. The value ranges from 15 minutes to 24 hours. The default value is 15 minutes.

  • Example request
    • When the methods parameter is set to assume_role
      {
          "auth": {
              "identity": {
                  "methods": [
                      "assume_role"
                  ],
                  "assume_role": {
                      "domain_id": "411edb4b634144f587ffc88f9bbdxxx",
                      "xrole_name": "testagency",
                      "duration_seconds": "3600"
                  }
              }
          }
      }
      
    • When the methods parameter is set to token
      {
          "auth": {
              "identity": {
                  "methods": [
                      "token"
                  ],
                  "token": {
                      "id": "MIIDkgYJKoZIhvcNAQcCoIIDgzCCA38CAQExDTALBglghkgBZQMEAgEwgXXXXX...",
                      "duration_seconds": "900"
                  }
              }
          }
      }

Response Parameters

  • Parameters in the response body

    Parameter

    Mandatory

    Type

    Description

    credential

    Yes

    Object

    Authentication information.

  • Description about the credential content.

    Parameter

    Mandatory

    Type

    Description

    expires_at

    Yes

    String

    Expiration time.

    access

    Yes

    String

    AK.

    secret

    Yes

    String

    SK.

    securitytoken

    Yes

    String

    Used for subsequent replacement of an SK or token.

  • Example response
    {
      "credential": {
        "access": "NQC51NFINJS1JXX...",
        "secret": "EY74MByPZ46kTRJL9ay5DskqXX...",
        "expires_at": "2017-04-17T07:55:18.575000Z",
        "securitytoken": "gAAAAABY9GbWUaGtoa9DPj7_dE4qUSnAXXX..."
      }
    }

Status Codes

Status Code

Description

201

The request is successful.

400

The server failed to process the request.

401

Authentication failed.

403

Access denied.

500

The system is abnormal.

Utilizamos cookies para mejorar nuestro sitio y tu experiencia. Al continuar navegando en nuestro sitio, tú aceptas nuestra política de cookies. Descubre más

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback