This repository has been archived by the owner on Nov 2, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
5 changed files
with
57 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { SVGProps } from 'react' | ||
|
||
export function UilKeySkeletonAlt(props: SVGProps<SVGSVGElement>) { | ||
return ( | ||
<svg xmlns="http://www.w3.org/2000/svg" width="1.5em" height="1.5em" viewBox="0 0 24 24" {...props}><path fill="currentColor" d="m21.71 6.53l-1.42-1.41l1.42-1.41a1 1 0 1 0-1.42-1.42L9.75 12.83a5 5 0 1 0 1.42 1.42l4.88-4.89l1.41 1.42a1 1 0 0 0 .71.29a1 1 0 0 0 .71-.29a1 1 0 0 0 0-1.42L17.46 8l1.42-1.42L20.29 8a1 1 0 0 0 .71.29a1 1 0 0 0 .71-.29a1 1 0 0 0 0-1.47M7 20a3 3 0 1 1 3-3a3 3 0 0 1-3 3"></path></svg> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# OAuth 2.0 | ||
|
||
import { Steps } from 'nextra/components'; | ||
|
||
在 Core v7.0.0 版本,Mx-Space 重写了第三方登录功能,抛弃了 Clerk,转而直接使用对应的账户授权 SDK 实现第三方登录。 | ||
|
||
## 如何配置 | ||
|
||
<Steps> | ||
|
||
### 新建应用 | ||
|
||
参考以下两篇: | ||
|
||
- [在 GitHub 新建 OAuth 应用](https://docs.github.com/zh/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app) | ||
- [在 Google Cloud 新建 OAuth 应用](https://developers.google.com/identity/protocols/oauth2/web-server?hl=zh-cn#creatingcred) | ||
|
||
对于 GitHub,`Homepage URL` 填写前端地址,`Authorization callback URL` 根据后台提示复制粘贴。 | ||
|
||
对于 Google,`已获授权的 JavaScript 来源` 填写前端地址,`已获授权的重定向 URI` 根据后台提示复制粘贴。 | ||
|
||
完成后会获取 Client ID 和 Client Secret,将他们复制下来备用。 | ||
|
||
### 后台设置 | ||
|
||
进入博客后台 -> 设定 -> 登录方式,在 OAuth 部分对应的平台名称下填写对应的 Client ID 和 Client Secret,保存后测试是否可以调用授权,若可调用即可启用并保存。 | ||
|
||
### 和主人身份绑定 | ||
|
||
在测试时通过 OAuth 授权登录后会提示是否将此账号设置为主人,允许即可。 | ||
|
||
</Steps> |