[Learn HarmonyOS Next Knowledge Every Day] Security and Network Requests
1. What information is required to obtain a JWT Token using an online generation tool?
A Service Account is an account that enables interface authentication between servers. You can create a service account on the API Console of the Huawei Developer Alliance. Based on the returned public and private keys, you can generate an authentication token in your business application to call Huawei's public APIs that support this authentication method.
The service account token is a JWT (JSON Web Token) formatted string, which consists of three parts:
- Header
- Payload
- Signature
These three parts are connected by ".", where the Signature is generated by signing the concatenated string of Header and Payload using the SHA256withRSA/PSS algorithm.
Reference document: Generate Authentication Tokens Based on Service Accounts - Development Steps
2. What is the purpose of the material directory generated after signing?
The material directory is generated by the IDE and is used to encrypt users' plaintext passwords.
3. Does the ArkWeb component support deep copying?
Does the ArkWeb component support deep copying, where ArkWeb component A is copied to ArkWeb component B, allowing B to continue using the resources of A after A is closed or exited from the routing stack?
This capability is currently unavailable. The only approach is to dynamically create a pool of web components, from which you can directly retrieve and display components by attaching them to the node tree as needed.
Reference document: Loading Pages with Web Components
4. Why does an HTTP request for a file larger than 5MB return an error code 2300023?
The default specification for HTTP requests allows a maximum transmission of 5MB data files. If the file exceeds this limit, use the http.requestInstream
capability instead.
For usage, refer to the document: requestInStream
5. Can paths starting with "internal" be replaced with other paths?
In the example at https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/js-apis-request-V5#requestuploadfile9, what is the purpose of paths starting with "internal," and can they be replaced with other paths or user file URIs?
In version 5.x, uploading user files is supported. You can pass in user paths that the application has permission to access or application sandbox paths.
Top comments (0)