Meitu Design Studio: Silent Login Integration for Meitu Products (Web)
1. Silent Login Flow
Login Steps
Step 1: The integrating party redirects to Meitu’s silent login endpoint by default, including code, access_key, and redirect_uri.
code: A temporary credential generated by the integrating party and provided to Meitu to retrieve the integrating party’s user information.
access_key: A unique identifier provided by Meitu to the developer.
redirect_uri: The Meitu product page to which the user is ultimately redirected after a successful login.
Step 2: Meitu uses the provided user information retrieval endpoint and code to request user information and link it to a Meitu account.
Step 3: The user is redirected to the corresponding Meitu product page, completing silent login.
2. Initiating Silent Login by the Integrating Party
When a user of the integrating party opens a Meitu product page, they are automatically logged in to a Meitu account.
For example, to silently log in to the Meitu Xiuxiu image editor at https://pc.meitu.com/image/edit/, the actual request URL should be https://account.meitu.com/open/silent_login?code=&access_key=*&redirect_uri=https%3A%2F%2Fpc.meitu.com%2Fimage%2Fedit%2F
If you need to use silent login with Meitu’s Web SDK, please refer to Section 4 of this document.
Request
| Basic Information | |
|---|---|
| HTTP URL | https://account.meitu.com/open/silent_login |
| HTTP Method | GET |
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | Credential used by Meitu to retrieve the integrating party’s user information |
| access_key | string | Yes | Unique identifier provided by Meitu to the developer |
| redirect_uri | string | Yes | Meitu product page URL (processed with urlencode). Only certain Meitu domains support silent login. If these do not meet your needs, please contact your Meitu integration contact. |
3. Meitu Retrieves User Information from the Integrating Party
Request
| Basic Information | |
|---|---|
| HTTP URL | (The endpoint URL is defined by the integrating party and submitted to the Meitu integration contact.) Zhang Wenzhao |
| HTTP Method | GET |
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | Credential for retrieving user information, randomly generated each time. It is recommended that each code be limited to a single use and have an expiration mechanism. |
| access_key | string | Yes | Unique identifier provided by Meitu to the developer |
Response
| Name | Type | Required | Description |
|---|---|---|---|
| code | int | Yes | Error code; a nonzero value indicates failure |
| msg | string | Yes | Error description |
| data | object | Yes | - |
| ∟ name | string | Yes | The integrating party’s user nickname, used when first linked to a Meitu account (because Meitu nicknames must be globally unique, the nickname may be changed if a conflict occurs) |
| ∟ avatar_url | string | Yes | The integrating party’s user avatar URL, used when first linked to a Meitu account |
| ∟ id | string | Yes | Unique identifier of the integrating party’s user; it may be a nonnumeric string |
Additional note: Due to security and regulatory requirements, nicknames and avatars may be replaced with compliant content if they are determined to contain illegal or sensitive content. Thank you for your understanding.
Example Response Body
Example{`` "code": 0,`` "msg": "success",`` "data": {`` "id": "enjdj328ydhhw3u43yjhdj",`` "name": "Zhang San",`` "avatar_url": "http://www.**.com/avatar/icon.jpg"`` }``} |
|---|
4. Silent Login in the Meitu Web SDK
In addition to directly constructing the silent login URL as described in Section 2, Meitu also provides services through a Web SDK. The Web SDK is encapsulated in JavaScript, so the integrating party cannot directly construct the target URL. Therefore, code and access_key must be passed as parameters when initializing the Web SDK.
// Example only. Please refer to the Web SDK documentation for the actual integration.``MTImageEditor.init({`` accessKey:**`` code:**`` ...``// Other parameters``}) |
|---|
5. Configuration Instructions
Our enterprise platform is not yet fully established. Please communicate privately to exchange the following sensitive information.
| Name | Provider | Meitu technical contact |
|---|---|---|
| Enterprise name | Integrating party | Zhang Wenzhao |
| Enterprise user information retrieval endpoint | Integrating party | Zhang Wenzhao |
| access_key | Meitu | Zheng Huiyang |
| secret_key | Meitu | Zheng Huiyang |