- Service Overview
- Billing
- Getting Started
-
User Guide
- Before You Start
- Buying an Instance
- Instance Management
-
Enterprise Administrator Guide
- Logging In to the OneAccess Administrator Portal
- User Management
-
Resources
- Overview
-
Applications
- Adding an Application
- Enabling, Disabling, or Deleting an Application
- General Information
- Authentication Integration
- Synchronization Integration
- Login Configuration
- Access Control
- Object Models
- Authorization Management
- API Permission Management
- Application Permission Management
- Security Settings
- Audit Logs
- APIs
- Authentication
- Security
- Audit
- Settings
- Common User Guide
- Key Operations Recorded by CTS
-
Best Practices
- OneAccess Best Practices
- Identity Source Integration
-
Application Integration
-
Logging In to the Huawei Cloud Through User Portal
- Introduction
- Logging In to Single Huawei Cloud Account via OneAccess Without Password (SAML - Virtual User SSO)
- Logging In to Multiple Huawei Cloud Accounts via OneAccess Without Password (SAML - Virtual User SSO)
- Logging In to Single Huawei Cloud Account via OneAccess Without Password (SAML - IAM User SSO)
- Logging In to Multiple Huawei Cloud Accounts via OneAccess Without Password (SAML - IAM User SSO)
- Logging In to Huawei Cloud via OneAccess Without Password (OIDC)
- SSO Access to Applications Through SAML
- SSO Access to Applications Through OAuth 2.0
- SSO Access to Applications Through OIDC
- SSO Access to Applications Through CAS
- SSO Access to Applications Through Plug-in Autocompletion
-
Logging In to the Huawei Cloud Through User Portal
- Data Synchronization
- Authentication Provider Integration
- Authorizing IAM Users to Access a OneAccess Instance Administrator Portal
- API Usage
- Configuring MFA for User Login
- Developer Guide
-
API Reference
- Before You Start
- API Overview
-
OneAccess APIs
-
Management APIs
- Calling APIs
- Access Credentials
-
User Management
- Creating a User
- Modifying a User
- Deleting a User
- Enabling a User
- Disabling a User
- Changing a User Password
- Verifying and Modifying the Original User Password
- Querying User Details by User ID
- Querying User Details by Username
- Querying the User List
- Authorizing an Application Account
- Querying All Authorized Application Accounts of a User
- Organization Management
- Application Organization Management
- Application Account Management
- Application Role Management
- User APIs
- Application Integration APIs
-
Management APIs
- Appendix
- FAQs
- General Reference
Copied.
Obtaining the Public Key
Function
This API is used to obtain the public key (each application has a unique public key). The public key is used to encrypt sensitive information when calling a service API.
URI
GET /api/v2/sdk/public-key
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-operating-sys-version |
Yes |
String |
Caller OS version, for example, Android 10. |
X-device-fingerprint |
Yes |
String |
Caller device fingerprint, for example, 156aysdna213sc50. |
X-device-ip |
No |
String |
Caller IP address, for example, 10.10.10.1 |
X-agent |
Yes |
String |
User agent information, for example, Mozilla/5.0 (Linux; Android 10; Redmi K30 Build/QKQ1.190825.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.99 Mobile Safari/537.36 |
X-L |
No |
String |
Language type, for example, en. |
X-client-id |
Yes |
String |
Application ID, which is a ClientId allocated to an application after registration. |
X-tenant-id |
No |
String |
Tenant ID. This parameter is mandatory when calling an ISV application. Replace "{domain_name}" with the ISV common domain name "{common_domain}". In the request header, specify tenant_id of the corresponding tenant and replace X-client-id with client_id of the ISV application template. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
public_key |
String |
Application public key. |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error details. |
Example Requests
Obtain the public key for encryption. In the request header configuration, the caller system is Android 10, the caller device fingerprint is 156aysdna213sac, the caller IP address is 10.10.10.1, and the application ID is ClientId allocated during application registration.
GET https://{domain_name}/api/v2/sdk/public-key X-operating-sys-version: Android 10 X-device-fingerprint: 156aysdna213sac X-device-ip: 10.10.10.1 X-agent: Mozilla/5.0 (Linux; Android 10; Redmi K30 Build/QKQ1.190825.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.99 Mobile Safari/537.36 X-L: zh X-client-id: DRrYIqauawN0I8myTMoDTPys6ezGZxnm X-tenant-id: 08f770f51f80d2f40f38c00cb199fd21
Example Responses
Status code: 200
Request successful.
{ "public_key" : "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAibkfo0k5yU8ZEt6D5Rl6\nmNGGlGKyl1dO237iEUtlttf48YUBMrruAvINc68cT5hwHoQdZDAXq6YaK6j+QkmD\nOr/wl5qUllrqrS5jMsyx80bWMkkJDmnV8WJWVlqmaEu1XJUTOinOlXHDwQtougP+\nq6Ai0gQC395QESR5t9WKCGIFMoWuEesCj1K8YUW3lSBojiz+vCYQSdy0xTOC3uWz\nxds4mDe4qeX+9wSH+XgFPCu/YpufNz+1iSBtALvpOGORT+zkPpt+0c7zvEpy+pgi\nsx0/aV5vA6S481ZCYZR3gzG4xthVuS0o022UGdr5RNy6SxvoIrx09JG2RvhdWsxW\n7wIDAQAB\n-----END PUBLIC KEY-----" }
Status Codes
Status Code |
Description |
---|---|
200 |
Request successful. |
400 |
Invalid parameter. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot