-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtemplates.json
More file actions
466 lines (466 loc) · 26.2 KB
/
Copy pathtemplates.json
File metadata and controls
466 lines (466 loc) · 26.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
{
"templates": [
{
"name": "OIDC 流程",
"name_en": "OIDC Flow",
"templates": [
{
"id": "add-custom-accesstoken",
"title_zh": "添加自定义 accessToken",
"title_en": "Add custom accessToken Claims",
"overview_zh": "添加自定义 accessToken,有关更多 OIDC 流程 code 换 access_token 的详细信息请见:https://docs.authing.cn/authing/advanced/oidc/oidc-authorization . 可以使用 OIDC 应用的 secret 解密 access_token: https://docs.authing.cn/authing/advanced/verify-jwt-token#oidc-secret-token",
"overview_en": "Add custom accessToken, if you want to check more details of OIDC flow, this might help you: :https://docs.authing.cn/authing/advanced/oidc/oidc-authorization . You can use OIDC App's secret to decrypt accessToken: https://docs.authing.cn/authing/advanced/verify-jwt-token#oidc-secret-token",
"categories": [
"OIDC 流程"
],
"categories_en": [
"OIDC Flow"
],
"triggers": [
"PRE_OIDC_ACCESS_TOKEN_ISSUED"
],
"code": "async function pipe(user, context, callback) {\n user.addAccessToken(\"KEY\", \"VALUE\")\n callback(null, user, context)\n}",
"async": false
},
{
"id": "add-custom-idtoken",
"title_zh": "添加自定义 idToken",
"title_en": "Add custom idToken Claims",
"overview_zh": "添加自定义 idToken,有关更多 OIDC 流程 code 换 id_token 的详细信息请见:https://docs.authing.cn/authing/advanced/oidc/oidc-authorization . 可以使用 OIDC 应用的 secret 解密 id_token: https://docs.authing.cn/authing/advanced/verify-jwt-token#oidc-secret-token",
"overview_en": "Add custom idToken, if you want to check more details of OIDC flow, this might help you: :https://docs.authing.cn/authing/advanced/oidc/oidc-authorization . You can use OIDC App's secret to decrypt idToken: https://docs.authing.cn/authing/advanced/verify-jwt-token#oidc-secret-token",
"categories": [
"OIDC 流程"
],
"categories_en": [
"OIDC Flow"
],
"triggers": [
"PRE_OIDCTOKENISSUED"
],
"code": "async function pipe(user, context, callback) {\n user.addIdToken(\"KEY\", \"VALUE\")\n callback(null, user, context)\n}",
"async": false
},
{
"id": "get-user-orglist",
"title_zh": "获取用户组织机构列表",
"title_en": "Get User Org List",
"overview_zh": "获取用户所在的组织机构列表",
"overview_en": "Get User Org List",
"categories": [
"OIDC 流程"
],
"categories_en": [
"OIDC Flow"
],
"triggers": [
"PRE_OIDCTOKENISSUED"
],
"code": "async function pipe(user, context, callback) {\n const userId = user.id;\n const orgList = await authing.users.listOrgs(userId)\n // 你可以使用 log 方法查看该函数的 \n // log(orgList)\n const orgIds = []\n for (const nodePath of orgList) {\n orgIds.push(nodePath.find(item => item.type === 'org').id)\n }\n user.addIdToken('orgIds', orgIds)\n callback(null, user, context)\n}",
"async": false
}
]
},
{
"name": "扩展用户字段",
"name_en": "Extend UserInfo",
"templates": [
{
"id": "add-location-to-metadata",
"title_zh": "将用户最新位置信息写入 Metadata",
"title_en": "Write the newest location of the user to Metadata",
"overview_zh": "将用户最新位置信息写入 Metadata, 使用前请务必判断 context.geo 是否存在 . context.geo 字段详细内容请见:https://docs.authing.cn//authing/extensibility/pipeline/context-object",
"overview_en": "Write the newest location of the user to Metadata, please do not to forget check if context.geo really exists. context.geo full reference can be found here: https://docs.authing.cn//authing/extensibility/pipeline/context-object .",
"categories": [
"扩展用户字段"
],
"categories_en": [
"Extend UserInfo"
],
"triggers": [
"POST_AUTHENTICATION"
],
"code": "async function pipe(user, context, callback) {\n // 请先判断是否成功获取 context.ip\n if (context.request.ip) {\n user.addCustomData('latestIp', JSON.stringify(context.request.ip))\n user.addCustomData(\"latestLocation\", JSON.stringify(context.request.geo))\n }\n callback(null, user, context)\n}",
"async": false
},
{
"id": "change-avatar-to-ui-avatars",
"title_zh": "使用 ui-avatars API 生成头像",
"title_en": "Generate Avatar by ui-avatars API",
"overview_zh": "根据用户名使用 ui-avatars API 生成头像,如 username 为 John Doe 的用户,头像为 https://ui-avatars.com/api/?name=John+Doe . 详情请见:https://ui-avatars.com/",
"overview_en": "Generate Avatar y ui-avatars API based on username. For example, if use's username if John Doe, his avatar will be https://ui-avatars.com/api/?name=John+Doe . More details about ui-avatar: https://ui-avatars.com/",
"categories": [
"扩展用户字段"
],
"categories_en": [
"Extend UserInfo"
],
"triggers": [
"POST_REGISTER",
"POST_AUTHENTICATION"
],
"code": "async function pipe(user, context, callback) {\n const name = user.username || user.nickname || user.email\n user.photo = `https://ui-avatars.com/api/?background=0D8ABC&color=fff&name=${name}`\n callback(null, user, context)\n}",
"async": false
},
{
"id": "change-default-avatar",
"title_zh": "修改默认头像",
"title_en": "Change Default Avatar",
"overview_zh": "Authing 默认的头像为:https://usercontents.authing.cn/authing-avatar.png . 这里可以修改成你自己想要的默认头像。",
"overview_en": "Authing's default avatar url is https://usercontents.authing.cn/authing-avatar.png, you can change it to anything you like .",
"categories": [
"扩展用户字段"
],
"categories_en": [
"Extend UserInfo"
],
"triggers": [
"POST_REGISTER"
],
"code": "async function pipe(user, context, callback) {\n user.photo = \"https://usercontents.authing.cn/avatar.png\"\n callback(null, user, context)\n}",
"async": false
},
{
"id": "fill-user-address-field",
"title_zh": "补充用户地理位置信息字段",
"title_en": "Fill User Address Field",
"overview_zh": "根据 context.geo 更新用户地理位置信息字段。 context.geo 字段详细内容请见:https://docs.authing.cn//authing/extensibility/pipeline/context-object",
"overview_en": "Update User address related field based on content.geo . context.geo full reference can be found here: https://docs.authing.cn//authing/extensibility/pipeline/context-object .",
"categories": [
"扩展用户字段"
],
"categories_en": [
"Extend UserInfo"
],
"triggers": [
"POST_REGISTER",
"POST_AUTHENTICATION"
],
"code": "async function pipe(user, context, callback) {\n if (context.request.geo) {\n const geo = context.request.geo;\n user.address = geo.address\n user.region = geo.province\n user.postalCode = geo.adcode\n }\n callback(null, user, context)\n}",
"async": false
},
{
"id": "get-repos-from-github-api",
"title_zh": "使用 GitHub API 获取用户 Repo 列表",
"title_en": "Fetch GitHub Repos and Add to Metadata",
"overview_zh": "当用户通过 GitHub 方式注册( context.connection === \"social:github\")时,调用 Github API (https://api.github.com/users/$username) 获取用户信息,将其保存至用户的 Metadata 。 更多 GitHub API 请见:https://developer.github.com/v3/ .",
"overview_en": "When user use GitHub to login/register (context.connection === \"social:github\"), Call Github API (https://api.github.com/users/$username) to get user data, and add it to user metadata . More about GitHub API: https://developer.github.com/v3/ .",
"categories": [
"扩展用户字段"
],
"categories_en": [
"Extend UserInfo"
],
"triggers": [
"POST_REGISTER",
"POST_AUTHENTICATION"
],
"code": "async function pipe(user, context, callback) {\n // 使用 GitHub 登录/注册\n if (context.connection === \"github\") {\n // 我们推荐使用 try/catch 包裹有可能 raise exception 的代码段\n try {\n // user.username 就是用户的 GitHub 用户名\n const res = await axios.get(`https://api.github.com/users/${user.username}/repos`)\n const repos = res.data\n user.addCustomData(\"repos\", JSON.stringify(repos))\n } catch (error) {\n log(error)\n }\n }\n callback(null, user, context)\n}",
"async": false
},
{
"id": "persist-metadata",
"title_zh": "添加自定义用户 Metadata",
"title_en": "Add Custom Meatadata and Persist",
"overview_zh": "为用户添加自定义字段 Metadata,并可以持久化保存至数据库。 user.addCustomData(\"KEY\",\"VALUE\") 仅对当前请求有效。 user.addCustomData(\"KEY\", \"VALUE\") 会保存至数据库。",
"overview_en": "Add custome user metadata, and persist it to database . user.addCustomData(\"KEY\",\"VALUE\") do not persist to database, means it only available in current request . user.addCustomData(\"KEY\", \"VALUE\") however will persist to database .",
"categories": [
"扩展用户字段"
],
"categories_en": [
"Extend UserInfo"
],
"triggers": [
"POST_REGISTER",
"POST_AUTHENTICATION"
],
"code": "async function pipe(user, context, callback) {\n user.addCustomData('KEY1', 'VALUE1')\n callback(null, user, context)\n}",
"async": false
}
]
},
{
"name": "访问控制",
"name_en": "Access Control",
"templates": [
{
"id": "block-on-weekend",
"title_zh": "每周日凌晨 3-6 点系统维护禁止注册/登录",
"title_en": "Block register/login every weekends",
"overview_zh": "每周日凌晨 3-6 点系统维护禁止注册/登录。",
"overview_en": "Block register/login every weekends for system management reason .",
"categories": [
"访问控制"
],
"categories_en": [
"Access Control"
],
"triggers": [
"PRE_REGISTER",
"PRE_AUTHENTICATION"
],
"code": "async function pipe(user, context, callback) {\n const date = new Date();\n const d = date.getDay();\n const n = date.getHours();\n // 每周日凌晨 3-6 点禁止注册\n if (d === 0 && (3 <= n && n <= 6)) {\n return callback(new Error('系统维护中,暂时停止注册!'));\n }\n callback(null, user, context)\n}",
"async": false
},
{
"id": "block-specific-connection",
"title_zh": "禁止特定方式注册",
"title_en": "Block specific register/login method",
"overview_zh": "禁止特定方式注册,注册方式可以通过 context.connection 获取。context.connection 可选值请见:https://docs.authing.cn/authing/extensibility/pipeline/context-object#connection .",
"overview_en": "Block specific register/login method, register/login method can be get from context.connection, details about context.connection can be found here: https://docs.authing.cn/authing/extensibility/pipeline/context-object#connection .",
"categories": [
"访问控制"
],
"categories_en": [
"Access Control"
],
"triggers": [
"PRE_REGISTER"
],
"code": "async function pipe(user, context, callback) {\n if (context.connection === \"weibo\") {\n return callback(new Error(\"当前系统禁止使用微博登录!\"))\n }\n callback(null, user, context)\n}",
"async": false
},
{
"id": "check-user-info-username",
"title_zh": "检查用户名",
"title_en": "Check username",
"overview_zh": "检查用户名是否填写。",
"overview_en": "Check if username is filled.",
"categories": [
"访问控制"
],
"categories_en": [
"Access Control"
],
"triggers": [
"PRE_COMPLETE_USER_INFO"
],
"code": "async function pipe(user, context, callback) {\n const username = user.username;\n if (!username) {\n return callback(new Error('Username required.'));\n }\n return callback(null, user, context);\n}",
"async": false
},
{
"id": "email-domain-whitelist",
"title_zh": "注册邮箱后缀白名单",
"title_en": "Register email domain whitelist",
"overview_zh": "若当前请求属于邮箱注册,只允许后缀为 example.com 的邮箱注册,否则返回 Access denied 错误提示。",
"overview_en": "Only allows user with email doamin example.com to register, or return Access denied Error .",
"categories": [
"访问控制"
],
"categories_en": [
"Access Control"
],
"triggers": [
"PRE_REGISTER"
],
"code": "async function pipe(user, context, callback) {\n const { email } = context.request.body\n // 非邮箱注册方式\n if (!email) {\n return callback(null, user, context)\n }\n if (!email.endsWith(\"example.com\")) {\n return callback(new Error('Access denied.'));\n }\n return callback(null, user, context);\n}",
"async": false
},
{
"id": "force-email-verified",
"title_zh": "强制邮箱验证之后才能登录",
"title_en": "Force Email to be Verified",
"overview_zh": "强制邮箱验证之后才能登录, 用户邮箱是否验证过可通过 user.emailVerified 获取。",
"overview_en": "Force email to be verified, whether use email is verified can be get from user.emailVerified .",
"categories": [
"访问控制"
],
"categories_en": [
"Access Control"
],
"triggers": [
"PRE_AUTHENTICATION"
],
"code": "async function pipe(user, context, callback) {\n if (!user.emailVerified) {\n return callback(new Error(\"请先验证邮箱!\"))\n }\n callback(null, user, context)\n}",
"async": false
},
{
"id": "force-phone-verifyed",
"title_zh": "强制手机号验证之后才能登录",
"title_en": "Force Phone to be Verified",
"overview_zh": "强制邮箱验证之后才能登录, 用户邮箱是否验证过可通过 user.phoneVerified 获取。",
"overview_en": "Force phone to be verified, whether use phone is verified can be get from user.phoneVerified .",
"categories": [
"访问控制"
],
"categories_en": [
"Access Control"
],
"triggers": [
"PRE_AUTHENTICATION"
],
"code": "async function pipe(user, context, callback) {\n if (!user.phoneVerified) {\n return callback(new Error(\"请先验证手机号!\"))\n }\n callback(null, user, context)\n}",
"async": false
},
{
"id": "ip-range-whitelist",
"title_zh": "注册 IP 段白名单",
"title_en": "Register IP Whitelist",
"overview_zh": "只允许在特定 IP 段的用户可以注册。 这里使用 utils.ipRangeCheck() 方法判断 IP 是否在 IP 段 110.53.254.1 ~ 110.53.254.255 之间。 有关内置 utils 模块的使用,请见 https://docs.authing.cn//authing/extensibility/pipeline/available-node-modules .",
"overview_en": "Only allows use who's ip in specific range . We use utils.ipRangeCheck() here to check if ip in range 110.53.254.1 ~ 110.53.254.255 . More about utils module: https://docs.authing.cn//authing/extensibility/pipeline/available-node-modules .",
"categories": [
"访问控制"
],
"categories_en": [
"Access Control"
],
"triggers": [
"PRE_REGISTER"
],
"code": "async function pipe(user, context, callback) {\n const utils = require(\"./utils\")\n const ip = context.request.ip\n if (ip && utils.ipRangeCheck(ip, [\"110.53.254.1\", \"110.53.254.255\"])) {\n return callback(null, user, context)\n }\n return callback(new Error('你不在允许注册/登录的 IP 范围内!'))\n}",
"async": false
},
{
"id": "ip-risk-analysis",
"title_zh": "根据 IP 风险评分屏蔽用户",
"title_en": "IP Risk Analysis",
"overview_zh": "IP 风险评分, 这里调用京东云市场的 API: https://wx.jdcloud.com/market/api/12678,如果风险评分大于 80,就屏蔽此用户。",
"overview_en": "Ip risk analysis",
"categories": [
"访问控制"
],
"categories_en": [
"Access Control"
],
"triggers": [
"POST_REGISTER",
"PRE_AUTHENTICATION"
],
"code": "async function pipe(user, context, callback) {\n try {\n const api = `https://way.jd.com/Dingxiang/ipquery?key=${context.ip}&appkey=${env.LOC_RISK_APPKEY}`\n const res = await axios.get(api)\n const data = res.data\n if (data.code === \"10000\") {\n const score = data.result.score\n if (score >= 80) {\n // 请不要调用 return callback(new Error())\n // 否则用户的 blocked 字段将不会保持!\n user.blocked = true\n }\n }\n } catch (error) {\n log(error)\n }\n callback(null, user, context)\n}",
"async": false
},
{
"id": "load-whitelist-on-cloud",
"title_zh": "通过 API 动态加载白名单",
"title_en": "Load Whitelist On Cloud",
"overview_zh": "通过 API 动态加载白名单. 比如你可以将白名单手机号写入一个 txt 文件,让外界可以通过 url 获取。",
"overview_en": "Danymic load whitelist using API, you can add phone number whitlist to a txt file for example .",
"categories": [
"访问控制"
],
"categories_en": [
"Access Control"
],
"triggers": [
"PRE_REGISTER",
"PRE_AUTHENTICATION"
],
"code": "async function pipe(user, context, callback) {\n const res = await axios.get('https://yourdomain.com/whitelist.txt')\n const whitelist = res.data.split('\\n')\n const email = user.email\n if (!email || whitelist.indexOf(email)) {\n return callback(new Error(\"Access Denied!\"))\n }\n callback(null, user, context)\n}",
"async": false
},
{
"id": "phone-whitelist",
"title_zh": "注册手机号白名单",
"title_en": "Register Phone Whitelist",
"overview_zh": "只有在白名单列表内的手机号才能注册,这里手机号列表用 \",\" 逗号隔开。 PHONE_WHITELIST 从全局环境变量 env 中获取,有关如何使用环境变量,请见:https://docs.authing.cn//authing/extensibility/pipeline/env .",
"overview_en": "Only phone number in specific range can register, phone number list is sperated by comma (',') . PHONE_WHITELIST is load from global object env, more information about how to use environment variables inside pipeline function: https://docs.authing.cn/authing/extensibility/pipeline/env .",
"categories": [
"访问控制"
],
"categories_en": [
"Access Control"
],
"triggers": [
"PRE_REGISTER"
],
"code": "async function pipe(_, context, callback) {\n // 非手机号注册跳过\n const phone = context.request.body;\n if (!phone) {\n return callback(null, context)\n }\n\n const whitelist = env.PHONE_WHITELIST.split(',')\n if (whitelist.indexOf(phone) === -1) {\n return callback(new Error('Access Denied!'))\n }\n return callback(null, _, context)\n}",
"async": false
}
]
},
{
"name": "WebHook",
"name_en": "WebHook",
"templates": [
{
"id": "dingtalk-notify",
"title_zh": "钉钉群通知",
"title_en": "Dingtalk Notify",
"overview_zh": "当有新用户注册时,通过钉钉群机器人通知。 DINGTALK_WEBHOOK 从全局环境变量 env 中获取,有关如何使用环境变量,请见:https://docs.authing.cn/authing/extensibility/pipeline/env . 有关钉钉群机器人使用方法请见:https://ding-doc.dingtalk.com/doc#/serverapi2/qf2nxq/d535db33 .",
"overview_en": "Notify using Dingtalk when new user registered . DINGTALK_WEBHOOK is load from global object env, more information about how to use environment variables inside pipeline function: https://docs.authing.cn/authing/extensibility/pipeline/env . More about Dingtalk group robot can be found here: https://ding-doc.dingtalk.com/doc#/serverapi2/qf2nxq/d535db33 .",
"categories": [
"WebHook"
],
"categories_en": [
"WebHook"
],
"triggers": [
"POST_REGISTER",
"POST_AUTHENTICATION"
],
"code": "async function pipe(user, context, callback) {\n const webhook = env.DINGTALK_WEBHOOK\n await axios.post(webhook, {\n \"msgtype\": \"text\",\n \"text\": {\n \"content\": `Authing 新用户注册 ~\nID: ${user.id}\n昵称:${user.username}\n注册方式:${user.registerMethod}\n邮箱:${user.email}\n手机号:${user.phone}\nUA: ${user.device}\n用户池 ID: ${user.userPoolId}`\n },\n })\n callback(null, user, context)\n}",
"async": true
},
{
"id": "lark-notify",
"title_zh": "飞书新注册通知",
"title_en": "Lark Notify",
"overview_zh": "当有新用户注册时,通过飞书群机器人通知。 LARK_WEBHOOK 从全局环境变量 env 中获取,有关如何使用环境变量,请见:https://docs.authing.cn/authing/extensibility/pipeline/env .",
"overview_en": "Notify using Lark when new user registered . LARK_WEBHOOK is load from global object env, more information about how to use environment variables inside pipeline function: https://docs.authing.cn/authing/extensibility/pipeline/env .",
"categories": [
"WebHook"
],
"categories_en": [
"WebHook"
],
"triggers": [
"POST_REGISTER",
"POST_AUTHENTICATION"
],
"code": "async function pipe(user, context, callback) {\n const webhook = env.LARK_WEBHOOK\n await axios.post(webhook, {\n title: \"Authing 新用户注册 ~\",\n text: `用户信息:\nID: ${user.id}\n昵称:${user.username}\n注册方式:${user.registerSource}\n邮箱:${user.email}\n手机号:${user.phone}\nUA: ${user.device}\n用户池 ID: ${user.userPoolId}\n`\n })\n return callback(null, user, context)\n}",
"async": true
},
{
"id": "slack-notify",
"title_zh": "Slack 群通知",
"title_en": "Slack Notify",
"overview_zh": "新用户注册 Slack 群通知。 SLACK_WEBHOOK 从全局环境变量 env 中获取,有关如何使用环境变量,请见:https://docs.authing.cn//authing/extensibility/pipeline/env . 有关 Slack Incoming Message 使用方法请见:https://www.slack.com/services/new/incoming-webhook .",
"overview_en": "Notify using Slack when new user registered . SLACK_WEBHOOK is load from global object env, more information about how to use environment variables inside pipeline function: https://docs.authing.cn/authing/extensibility/pipeline/env . More about Slack Incoming Message can be found here: https://www.slack.com/services/new/incoming-webhook .",
"categories": [
"WebHook"
],
"categories_en": [
"WebHook"
],
"triggers": [
"POST_REGISTER",
"POST_AUTHENTICATION"
],
"code": "async function pipe(user, context, callback) {\n const qs = require('querystring')\n const webhook = env.SLACK_WEBHOOK\n const body = qs.stringify({\n payload: JSON.stringify({\n text: `Authing 新用户注册 ~\nID: ${user.id}\n昵称:${user.username}\n注册方式:${user.registerSource}\n邮箱:${user.email}\n手机号:${user.phone}\nUA: ${user.device}\n用户池 ID: ${user.userPoolId}\n`\n })\n })\n await axios.post(webhook, body, {\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded'\n }\n })\n callback(null, user, context)\n}",
"async": true
}
]
}
],
"triggers": [
{
"name": "PRE_REGISTER",
"desc": "注册前",
"desc_en": "Before Register"
},
{
"name": "POST_REGISTER",
"desc": "注册后",
"desc_en": "After Register"
},
{
"name": "POST_AUTHENTICATION",
"desc": "认证后",
"desc_en": "After Authentication"
},
{
"name": "PRE_OIDCTOKENISSUED",
"desc": "OIDC 签发 Id Token 前",
"desc_en": "OIDC Before Code Exchange Id Token"
},
{
"name": "PRE_OIDC_ACCESS_TOKEN_ISSUED",
"desc": "OIDC 签发 Access Token 前",
"desc_en": "OIDC Before Code Exchange Access Token"
},
{
"name": "PRE_COMPLETE_USER_INFO",
"desc": "用户补全信息前",
"desc_en": "Before User Complete Information"
}
]
}