mirror of
https://github.com/logto-io/logto.git
synced 2024-12-30 20:33:54 -05:00
3fa2b796e6
* feat(connector): add Xiaomi social login connector * chore: update README and pnpm lock * chore: update changeset * fix(connector): fix connector-xiaomi test fail & enhance error handling * refactor(connector): remove unnecessary logs and code --------- Co-authored-by: Charles Zhao <charleszhao@silverhand.io> |
||
---|---|---|
.. | ||
src | ||
logo.svg | ||
package.json | ||
README.md | ||
README.zh-CN.md |
Xiaomi social connector
The official Logto connector for Xiaomi social sign-in. 中文文档
Table of contents
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_id
can be found on the top of the connector details page in Logto Console
- Get
AppID
andAppSecret
from the application details page - Fill in the
clientId
andclientSecret
fields 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.