Bu sayfa henüz yerel dilinizde mevcut değildir. Daha fazla dil seçeneği eklemek için yoğun bir şekilde çalışıyoruz. Desteğiniz için teşekkür ederiz.

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
OneAccess
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
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

Using a Custom Authorizer

Updated on 2023-08-28 GMT+08:00

Creating a Custom Authentication API

Create an API that uses a custom authorizer in ROMA Connect.

  1. In the left navigation pane on the instance console, choose API Connect > APIs. In the upper right corner, click Create API.
  2. On the page displayed, configure the frontend definition of the API.
    Figure 1 Frontend configuration
    Table 1 Frontend configuration

    Parameter

    Description

    API Name

    Enter an API name.

    Integration Application

    Select the integration application created in Creating a Function Backend for Frontend Authentication.

    Group

    Select an API group for the frontend API. If no API group is available, click Create API Group on the right to create one.

    URL

    Configure the API access address.

    • Method: request method of the API. Set this parameter to GET here.
    • Protocol: request protocol of the API. Set this parameter to HTTPS here.
    • Path: request path of the API, in /getUserInfo/{userId} format. Set this parameter to /test here.

    Matching

    Matching mode of the API request path. Set this parameter to Exact match here.

    Tags

    Retain the default settings.

    Description

    Retain the default settings.

  3. Configure API security information.
    Figure 2 Security configuration
    Table 2 Security configuration

    Parameter

    Description

    Visibility

    Whether the API can be released to the marketplace. Retain the default value Public, which indicates that the API can be released to the marketplace.

    Authentication Mode

    Select Custom.

    Custom Authorizer

    Select the custom authorizer created in Creating a Frontend Custom Authorizer.

    CORS

    Retain the default setting to disable CORS.

  4. Configure the request parameters of the API. Or skip this step and click Next.
  5. Set the backend type. In this example, select Mock to return specified response.
  6. Configure API backend information.
    Figure 3 Backend configuration
    Table 3 Backend configuration

    Parameter

    Description

    Status Code

    Select the HTTP status code returned by the API. Use 200 here.

    Response

    Enter the response result of the API. In this example, set this parameter to ROMA TEST!. Once you call the API, ROMA TEST! is returned.

    Backend Authentication

    Retain the default setting to disable backend authentication.

    Add Header

    Retain the default settings.

  7. Configure the response example. Retain the default settings.
  8. Click Finish.

    After the API is created, the API details page is displayed.

Debugging an API

  1. On the details page of the API created in Creating a Custom Authentication API, click Debug in the upper right corner.
  2. On the page displayed, click the Headers tab, and click Add Request Parameter.
  3. Set Parameter name to x-auth and Parameter value to user1:xxxx.
    Figure 4 API debugging
  4. Click Debug on the right of the URL. The request sent when you call the API and the response received are displayed in the lower part of the page.

    The message ROMA TEST! is displayed, indicating that the API is successfully called.

    HTTP/1.1 200 OK
    Transfer-Encoding: chunked
    Connection: keep-alive
    Content-Type: application/json
    ...
    
    ROMA TEST!
  5. Delete the request parameter x-auth added in 3 and click Debug again.

    The response indicates that the API fails to be called, and the error message indicates that the authentication information is incorrect.

    HTTP/1.1 401 Unauthorized
    Transfer-Encoding: chunked
    Connection: keep-alive
    Content-Type: application/json
    ...
    
    {"error_msg":"Incorrect authentication information: frontend authorizer","error_code":"APIC.0305","request_id":"56b2c6ae4a49f44b88670201eade9e05"}

Sitemizi ve deneyiminizi iyileştirmek için çerezleri kullanırız. Sitemizde tarama yapmaya devam ederek çerez politikamızı kabul etmiş olursunuz. Daha fazla bilgi edinin

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback