Set up social login with Xiaomi
The official Logto connector for Xiaomi social sign-in.
tip:
This guide assumes you have basic understanding of Logto Connectors. For those unfamiliar, please refer to the Connectors guide to get started.
Get started
- Create a developer account at Xiaomi Open Platform
- Visit Xiaomi Account Service
- Create a new application if you don't have one
Configure Xiaomi OAuth application
- Visit Xiaomi Account Service
- Configure OAuth settings:
- Open the application you want to use for login, click on "Callback URL" (if you haven't edited the callback URL, it will display as "Enabled")
- Add authorization callback URL:
${your_logto_origin}/callback/${connector_id} connector_idcan be found on the top of the connector details page in Logto Console
- Get
AppIDandAppSecretfrom the application details page - Fill in the
clientIdandclientSecretfields in Logto Console with the values from step 3 - Optional configuration:
skipConfirm: Whether to skip the Xiaomi authorization confirmation page when user is already logged in to Xiaomi account, defaults to false
Scopes description
By default, the connector requests the following scope:
1: Read user profile
Available scopes:
| Scope Value | Description | API Interface |
|---|---|---|
| 1 | Get user profile | user/profile |
| 3 | Get user open_id | user/openIdV2 |
| 1000 | Get Xiaomi router info | Mi Router |
| 1001 | Access all Xiaomi router info | Mi Router |
| 2001 | Access Xiaomi cloud calendar | Mi Cloud |
| 2002 | Access Xiaomi cloud alarm | Mi Cloud |
| 6000 | Use Mi Home smart home service | Mi Home |
| 6002 | Add third-party devices to Mi Home | Mi Home |
| 6003 | Alexa control Xiaomi devices | Mi Home |
| 6004 | Third-party service access to Xiaomi devices | Mi Home |
| 7000 | Follow Yellow Pages service account | Mi Cloud |
| 11000 | Get Xiaomi cloud photos | Mi Cloud |
| 12001 | Save app data to Mi Cloud | Mi Cloud |
| 12005 | Use health ECG service | Health |
| 16000 | Get Mi Wallet passes | app/get_pass |
| 20000 | Enable XiaoAI voice service | XiaoAI |
| 40000 | Enable cloud AI service | Internal Use |
Multiple scopes can be configured by separating them with spaces, e.g.: 1 3 6000.
Test Xiaomi connector
That's it. Don't forget to Enable social sign-in in the sign-in experience.
References
Xiaomi OAuth 2.0 Documentation
Xiaomi Get User Profile Documentation