Meitu Design Studio: Silent Login Integration for Meitu Products (Web)

1. Silent Login Flow

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 URLhttps://account.meitu.com/open/silent_login
HTTP MethodGET

Parameters

NameTypeRequiredDescription
codestringYesCredential used by Meitu to retrieve the integrating party’s user information
access_keystringYesUnique identifier provided by Meitu to the developer
redirect_uristringYesMeitu 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 MethodGET

Parameters

NameTypeRequiredDescription
codestringYesCredential 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_keystringYesUnique identifier provided by Meitu to the developer

Response

NameTypeRequiredDescription
codeintYesError code; a nonzero value indicates failure
msgstringYesError description
dataobjectYes-
∟ namestringYesThe 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_urlstringYesThe integrating party’s user avatar URL, used when first linked to a Meitu account
∟ idstringYesUnique 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.

NameProviderMeitu technical contact
Enterprise nameIntegrating partyZhang Wenzhao
Enterprise user information retrieval endpointIntegrating partyZhang Wenzhao
access_keyMeituZheng Huiyang
secret_keyMeituZheng Huiyang