-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(doc): update authing doc/weibo doc
- Loading branch information
1 parent
8d4ef3b
commit 5e473ee
Showing
5 changed files
with
89 additions
and
14 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
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,38 @@ | ||
--- | ||
outline: deep | ||
--- | ||
|
||
# 使用Authing实现小程序登录 | ||
|
||
> 使用 Authing 快速实现任何 Web、App 和企业软件的身份认证和用户管理, 为你的客户和员工提供完善的登录解决方案 | ||
[Authing](https://www.authing.cn/) | ||
|
||
## 1. 注册Authing账号,并配置应用 | ||
|
||
## 2. 配置应用>身份源管理>社会化身份源 | ||
|
||
![支持多种不同的身份源](static/authing.png) | ||
|
||
## 3. 配置`next-auth` | ||
|
||
```typescript | ||
import NextAuth from 'next-auth' | ||
import { Authing } from 'next-auth-oauth' | ||
|
||
export default NextAuth({ | ||
providers: [Authing], | ||
}) | ||
``` | ||
|
||
## 3. 配置`Authing`的环境变量,修改`.env`文件 | ||
|
||
``` | ||
AUTH_AUTHING_ID=下图中的APPID | ||
AUTH_AUTHING_SECRET=下图中的APP SECRET | ||
AUTH_AUTHING_DOMAIN= 下图中的认证配置->认证地址 | ||
``` | ||
|
||
**由于认证配置-认证地址可以自定义,所以每个人会不一样,一定要注意** | ||
|
||
![应用配置](static/authing_config.png) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,29 @@ | ||
--- | ||
outline: deep | ||
--- | ||
|
||
# 使用微博登录 | ||
|
||
> 支持微博登录 | ||
## 1. 注册微博开发者账号 | ||
|
||
## 2. 创建应用 | ||
|
||
## 3. 配置`next-auth` | ||
|
||
```typescript | ||
import NextAuth from 'next-auth' | ||
import Weibo from '@next-auth-oauth/weibo' | ||
|
||
export default NextAuth({ | ||
providers: [Weibo], | ||
}) | ||
``` | ||
|
||
## 3. 配置`Weibo`的环境变量,修改`.env`文件 | ||
|
||
``` | ||
AUTH_WEIBO_ID=APPID | ||
AUTH_WEIBO_SECRET= | ||
``` |