非阻塞事件¶
Hook 必须在 60 秒内完成。否则,投递会因超时而失败。对于 Webhook,您的服务器必须返回 2xx 范围内的 HTTP 状态码。其他状态码会被视为投递失败。
Hook 的响应内容会被忽略。
非阻塞事件列表¶
- user.created
- user.profile.updated
- user.authenticated
- user.disabled
- user.reenabled
- user.anonymous.promoted
- user.deletion_scheduled
- user.deletion_unscheduled
- user.deleted
- identity.email.added
- identity.email.removed
- identity.email.updated
- identity.email.verified
- identity.email.unverified
- identity.phone.added
- identity.phone.removed
- identity.phone.updated
- identity.phone.verified
- identity.phone.unverified
- identity.username.added
- identity.username.removed
- identity.username.updated
- identity.oauth.connected
- identity.oauth.disconnected
- identity.biometric.enabled
- identity.biometric.disabled
user.created¶
在创建新用户之后发生。用户可以通过注册、以匿名用户身份注册创建,也可以由管理员通过管理台或 Admin API 创建。
{
"type": "user.created",
"payload": {
"user": {
"id": "338deafa-400b-4589-a922-2c92d670b757",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"last_login_at": "2006-01-02T03:04:05.123456Z",
"is_anonymous": false,
"is_verified": true,
"is_disabled": false,
"is_deactivated": false,
"can_reauthenticate": true,
"standard_attributes": {
"email": "user@example.com",
"email_verified": true,
"updated_at": 1136171045
}
},
"identities": [
{
"id": "239d585d-9b90-4148-9aa2-2e3131b5847a",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"type": "login_id",
"claims": {
"email": "user@example.com",
"https://authgear.com/claims/login_id/key": "email",
"https://authgear.com/claims/login_id/original_value": "user@example.com",
"https://authgear.com/claims/login_id/type": "email",
"https://authgear.com/claims/login_id/value": "user@example.com"
}
}
]
}
}
user.profile.updated¶
在用户资料更新时发生。
{
"type": "user.profile.updated",
"payload": {
"user": {
"id": "338deafa-400b-4589-a922-2c92d670b757",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"last_login_at": "2006-01-02T03:04:05.123456Z",
"is_anonymous": false,
"is_verified": true,
"is_disabled": false,
"is_deactivated": false,
"can_reauthenticate": true,
"standard_attributes": {
"email": "user@example.com",
"email_verified": true,
"name": "Chris",
"updated_at": 1136171045
}
}
}
}
user.authenticated¶
在用户登录之后发生。
{
"type": "user.authenticated",
"payload": {
"user": {
"id": "338deafa-400b-4589-a922-2c92d670b757",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"last_login_at": "2006-01-02T03:04:05.123456Z",
"is_anonymous": false,
"is_verified": true,
"is_disabled": false,
"is_deactivated": false,
"can_reauthenticate": true,
"standard_attributes": {
"email": "user@example.com",
"email_verified": true,
"updated_at": 1136171045
}
},
"session": {
"id": "6e6e5d9b-7f85-4a8f-a157-2de94694dfea",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"type": "idp",
"amr": ["pwd"],
"lastAccessedAt": "2006-01-02T03:04:05.123456Z",
"createdByIP": "127.0.0.1",
"lastAccessedByIP": "127.0.0.1",
"lastAccessedByIPCountryCode": "",
"lastAccessedByIPEnglishCountryName": "",
"displayName": "Chrome 104.0.0"
}
}
}
user.disabled¶
在用户被禁用时发生。
{
"type": "user.disabled",
"payload": {
"user": {
"id": "338deafa-400b-4589-a922-2c92d670b757",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"last_login_at": "2006-01-02T03:04:05.123456Z",
"is_anonymous": false,
"is_verified": true,
"is_disabled": true,
"is_deactivated": false,
"can_reauthenticate": true,
"standard_attributes": {
"email": "user@example.com",
"email_verified": true,
"updated_at": 1136171045
}
}
}
}
user.reenabled¶
在用户被重新启用时发生。
{
"type": "user.reenabled",
"payload": {
"user": {
"id": "338deafa-400b-4589-a922-2c92d670b757",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"last_login_at": "2006-01-02T03:04:05.123456Z",
"is_anonymous": false,
"is_verified": true,
"is_disabled": false,
"is_deactivated": false,
"can_reauthenticate": true,
"standard_attributes": {
"email": "user@example.com",
"email_verified": true,
"updated_at": 1136171045
}
}
}
}
user.anonymous.promoted¶
在匿名用户升级为正式用户时发生。
{
"type": "user.anonymous.promoted",
"payload": {
"anonymous_user": {
"id": "7a009f88-c636-4245-91ec-7b174dc6a1a1",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"last_login_at": "2006-01-02T03:04:05.123456Z",
"is_anonymous": false,
"is_verified": true,
"is_disabled": false,
"is_deactivated": false,
"can_reauthenticate": true,
"standard_attributes": {
"email": "user@example.com",
"email_verified": true,
"updated_at": 1136171045
}
},
"user": {
"id": "7a009f88-c636-4245-91ec-7b174dc6a1a1",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"last_login_at": "2006-01-02T03:04:05.123456Z",
"is_anonymous": false,
"is_verified": true,
"is_disabled": false,
"is_deactivated": false,
"can_reauthenticate": true,
"standard_attributes": {
"email": "user@example.com",
"email_verified": true,
"updated_at": 1136171045
}
},
"identities": [
{
"id": "1450234b-5e2c-4aa0-b400-f2d9d70a2f45",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"type": "login_id",
"claims": {
"email": "user@example.com",
"https://authgear.com/claims/login_id/key": "email",
"https://authgear.com/claims/login_id/original_value": "user@example.com",
"https://authgear.com/claims/login_id/type": "email",
"https://authgear.com/claims/login_id/value": "user@example.com"
}
}
]
}
}
user.deletion_scheduled¶
在账号删除被安排时发生。
{
"type": "user.deletion_scheduled",
"payload": {
"user": {
"id": "338deafa-400b-4589-a922-2c92d670b757",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"last_login_at": "2006-01-02T03:04:05.123456Z",
"is_anonymous": false,
"is_verified": true,
"is_disabled": true,
"is_deactivated": true,
"delete_at": "2006-01-02T03:04:05.123456Z",
"can_reauthenticate": true,
"standard_attributes": {
"email": "user@example.com",
"email_verified": true,
"updated_at": 1136171045
}
}
}
}
user.deletion_unscheduled¶
在已安排的账号删除被取消时发生。
{
"type": "user.deletion_unscheduled",
"payload": {
"user": {
"id": "338deafa-400b-4589-a922-2c92d670b757",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"last_login_at": "2006-01-02T03:04:05.123456Z",
"is_anonymous": false,
"is_verified": true,
"is_disabled": false,
"is_deactivated": false,
"can_reauthenticate": true,
"standard_attributes": {
"email": "user@example.com",
"email_verified": true,
"updated_at": 1136171045
}
}
}
}
user.deleted¶
在用户被删除时发生。
{
"type": "user.deleted",
"payload": {
"user": {
"id": "338deafa-400b-4589-a922-2c92d670b757",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"last_login_at": "2006-01-02T03:04:05.123456Z",
"is_anonymous": false,
"is_verified": false,
"is_disabled": false,
"is_deactivated": false,
"can_reauthenticate": false,
"standard_attributes": {
"email": "user@example.com",
"email_verified": false,
"updated_at": 1136171045
}
}
}
}
identity.email.added¶
在为现有用户添加新邮箱时发生。用户可以在设置页面添加邮箱,管理员也可以通过 Admin API 或管理台添加。
{
"type": "identity.email.added",
"payload": {
"user": {
"id": "338deafa-400b-4589-a922-2c92d670b757",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"last_login_at": "2006-01-02T03:04:05.123456Z",
"is_anonymous": false,
"is_verified": true,
"is_disabled": false,
"is_deactivated": false,
"can_reauthenticate": true,
"standard_attributes": {
"email": "user@example.com",
"email_verified": true,
"phone_number": "+447400123456",
"phone_number_verified": true,
"updated_at": 1136171045
}
},
"identity": {
"id": "a0c55481-147e-4a58-876e-10dffedfd5cd",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"type": "login_id",
"claims": {
"email": "user@example.com",
"https://authgear.com/claims/login_id/key": "email",
"https://authgear.com/claims/login_id/original_value": "user@example.com",
"https://authgear.com/claims/login_id/type": "email",
"https://authgear.com/claims/login_id/value": "user@example.com"
}
}
}
}
identity.email.removed¶
在从现有用户移除邮箱地址时发生。用户可以在设置页面移除邮箱,管理员也可以通过 Admin API 或管理台移除。
{
"type": "identity.email.removed",
"payload": {
"user": {
"id": "338deafa-400b-4589-a922-2c92d670b757",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"last_login_at": "2006-01-02T03:04:05.123456Z",
"is_anonymous": false,
"is_verified": true,
"is_disabled": false,
"is_deactivated": false,
"can_reauthenticate": true,
"standard_attributes": {
"phone_number": "+447400123456",
"phone_number_verified": true,
"updated_at": 1136171045
}
},
"identity": {
"id": "239d585d-9b90-4148-9aa2-2e3131b5847a",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"type": "login_id",
"claims": {
"email": "user@example.com",
"https://authgear.com/claims/login_id/key": "email",
"https://authgear.com/claims/login_id/original_value": "user@example.com",
"https://authgear.com/claims/login_id/type": "email",
"https://authgear.com/claims/login_id/value": "user@example.com"
}
}
}
}
identity.email.updated¶
在邮箱地址更新时发生。用户可以在设置页面更新邮箱。
{
"type": "identity.email.updated",
"payload": {
"user": {
"id": "338deafa-400b-4589-a922-2c92d670b757",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"last_login_at": "2006-01-02T03:04:05.123456Z",
"is_anonymous": false,
"is_verified": true,
"is_disabled": false,
"is_deactivated": false,
"can_reauthenticate": true,
"standard_attributes": {
"email": "user3@example.com",
"email_verified": true,
"updated_at": 1136171045
}
},
"new_identity": {
"id": "239d585d-9b90-4148-9aa2-2e3131b5847a",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"type": "login_id",
"claims": {
"email": "user3@example.com",
"https://authgear.com/claims/login_id/key": "email",
"https://authgear.com/claims/login_id/original_value": "user3@example.com",
"https://authgear.com/claims/login_id/type": "email",
"https://authgear.com/claims/login_id/value": "user3@example.com"
}
},
"old_identity": {
"id": "239d585d-9b90-4148-9aa2-2e3131b5847a",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"type": "login_id",
"claims": {
"email": "user@example.com",
"https://authgear.com/claims/login_id/key": "email",
"https://authgear.com/claims/login_id/original_value": "user@example.com",
"https://authgear.com/claims/login_id/type": "email",
"https://authgear.com/claims/login_id/value": "user@example.com"
}
}
}
}
identity.email.verified¶
在现有用户的邮箱地址从未验证变为已验证时发生。用户可以在设置页面验证邮箱,管理员也可以通过 Admin API 或管理台将其标记为已验证。
{
"type": "identity.email.verified",
"payload": {
"user": {
"id": "338deafa-400b-4589-a922-2c92d670b757",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"last_login_at": "2006-01-02T03:04:05.123456Z",
"is_anonymous": false,
"is_verified": true,
"is_disabled": false,
"is_deactivated": false,
"can_reauthenticate": true,
"standard_attributes": {
"email": "user@example.com",
"email_verified": true,
"updated_at": 1136171045
}
},
"identity": {
"id": "239d585d-9b90-4148-9aa2-2e3131b5847a",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"type": "login_id",
"claims": {
"email": "user@example.com",
"https://authgear.com/claims/login_id/key": "email",
"https://authgear.com/claims/login_id/type": "email",
"https://authgear.com/claims/login_id/value": "user@example.com"
}
}
}
}
identity.email.unverified¶
在邮箱地址被取消验证时发生。可以通过 Admin API 取消邮箱的验证状态。
{
"type": "identity.email.unverified",
"payload": {
"user": {
"id": "338deafa-400b-4589-a922-2c92d670b757",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"last_login_at": "2006-01-02T03:04:05.123456Z",
"is_anonymous": false,
"is_verified": false,
"is_disabled": false,
"is_deactivated": false,
"can_reauthenticate": true,
"standard_attributes": {
"email": "user@example.com",
"email_verified": false,
"updated_at": 1136171045
}
},
"identity": {
"id": "239d585d-9b90-4148-9aa2-2e3131b5847a",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"type": "login_id",
"claims": {
"email": "user@example.com",
"https://authgear.com/claims/login_id/key": "email",
"https://authgear.com/claims/login_id/type": "email",
"https://authgear.com/claims/login_id/value": "user@example.com"
}
}
}
}
identity.phone.added¶
在为现有用户添加新手机号时发生。用户可以在设置页面添加手机号,管理员也可以通过 Admin API 或管理台添加。
{
"type": "user.phone.added",
"payload": {
"user": {
"id": "338deafa-400b-4589-a922-2c92d670b757",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"last_login_at": "2006-01-02T03:04:05.123456Z",
"is_anonymous": false,
"is_verified": true,
"is_disabled": false,
"is_deactivated": false,
"can_reauthenticate": true,
"standard_attributes": {
"email": "user@example.com",
"email_verified": true,
"phone_number": "+447400123456",
"phone_number_verified": true,
"updated_at": 1136171045
}
},
"identity": {
"id": "9fa5668d-a796-4817-93e1-d4096e5966ac",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"type": "login_id",
"claims": {
"https://authgear.com/claims/login_id/key": "phone",
"https://authgear.com/claims/login_id/original_value": "+447400123456",
"https://authgear.com/claims/login_id/type": "phone",
"https://authgear.com/claims/login_id/value": "+447400123456",
"phone_number": "+447400123456"
}
}
}
}
identity.phone.removed¶
在从现有用户移除手机号时发生。用户可以在设置页面移除手机号,管理员也可以通过 Admin API 或管理台移除。
{
"type": "identity.phone.removed",
"payload": {
"user": {
"id": "338deafa-400b-4589-a922-2c92d670b757",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"last_login_at": "2006-01-02T03:04:05.123456Z",
"is_anonymous": false,
"is_verified": true,
"is_disabled": false,
"is_deactivated": false,
"can_reauthenticate": true,
"standard_attributes": {
"email": "user@example.com",
"email_verified": true,
"updated_at": 1136171045
}
},
"identity": {
"id": "9fa5668d-a796-4817-93e1-d4096e5966ac",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"type": "login_id",
"claims": {
"https://authgear.com/claims/login_id/key": "phone",
"https://authgear.com/claims/login_id/original_value": "+447400123455",
"https://authgear.com/claims/login_id/type": "phone",
"https://authgear.com/claims/login_id/value": "+447400123455",
"phone_number": "+447400123455"
}
}
}
}
identity.phone.updated¶
在手机号更新时发生。用户可以在设置页面更新手机号。
{
"type": "identity.phone.updated",
"payload": {
"user": {
"id": "338deafa-400b-4589-a922-2c92d670b757",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"last_login_at": "2006-01-02T03:04:05.123456Z",
"is_anonymous": false,
"is_verified": true,
"is_disabled": false,
"is_deactivated": false,
"can_reauthenticate": true,
"standard_attributes": {
"email": "user@example.com",
"email_verified": true,
"phone_number": "+447400123455",
"phone_number_verified": true,
"updated_at": 1136171045
}
},
"new_identity": {
"id": "9fa5668d-a796-4817-93e1-d4096e5966ac",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"type": "login_id",
"claims": {
"https://authgear.com/claims/login_id/key": "phone",
"https://authgear.com/claims/login_id/original_value": "+447400123455",
"https://authgear.com/claims/login_id/type": "phone",
"https://authgear.com/claims/login_id/value": "+447400123455",
"phone_number": "+447400123455"
}
},
"old_identity": {
"id": "9fa5668d-a796-4817-93e1-d4096e5966ac",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"type": "login_id",
"claims": {
"https://authgear.com/claims/login_id/key": "phone",
"https://authgear.com/claims/login_id/original_value": "+447400123456",
"https://authgear.com/claims/login_id/type": "phone",
"https://authgear.com/claims/login_id/value": "+447400123456",
"phone_number": "+447400123456"
}
}
}
}
identity.phone.verified¶
在现有用户的手机号从未验证变为已验证时发生。用户可以在设置页面验证手机号,管理员也可以通过 Admin API 或管理台将其标记为已验证。
{
"type": "identity.phone.verified",
"payload": {
"user": {
"id": "338deafa-400b-4589-a922-2c92d670b757",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"last_login_at": "2006-01-02T03:04:05.123456Z",
"is_anonymous": false,
"is_verified": true,
"is_disabled": false,
"is_deactivated": false,
"can_reauthenticate": true,
"standard_attributes": {
"email": "user@example.com",
"email_verified": true,
"phone_number": "+447400123455",
"phone_number_verified": true,
"updated_at": 1136171045
}
},
"identity": {
"id": "9fa5668d-a796-4817-93e1-d4096e5966ac",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"type": "login_id",
"claims": {
"https://authgear.com/claims/login_id/key": "phone",
"https://authgear.com/claims/login_id/type": "phone",
"https://authgear.com/claims/login_id/value": "+447400123455",
"phone_number": "+447400123455"
}
}
}
}
identity.phone.unverified¶
在手机号被取消验证时发生。可以通过 Admin API 取消手机号的验证状态。
{
"type": "identity.phone.unverified",
"payload": {
"user": {
"id": "338deafa-400b-4589-a922-2c92d670b757",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"last_login_at": "2006-01-02T03:04:05.123456Z",
"is_anonymous": false,
"is_verified": false,
"is_disabled": false,
"is_deactivated": false,
"can_reauthenticate": true,
"standard_attributes": {
"email": "user@example.com",
"email_verified": true,
"phone_number": "+447400123455",
"phone_number_verified": false,
"updated_at": 1136171045
}
},
"identity": {
"id": "9fa5668d-a796-4817-93e1-d4096e5966ac",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"type": "login_id",
"claims": {
"https://authgear.com/claims/login_id/key": "phone",
"https://authgear.com/claims/login_id/type": "phone",
"https://authgear.com/claims/login_id/value": "+447400123455",
"phone_number": "+447400123455"
}
}
}
}
identity.username.added¶
在为现有用户添加新用户名时发生。用户可以在设置页面添加用户名,管理员也可以通过 Admin API 或管理台添加。
{
"type": "identity.username.added",
"payload": {
"user": {
"id": "338deafa-400b-4589-a922-2c92d670b757",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"last_login_at": "2006-01-02T03:04:05.123456Z",
"is_anonymous": false,
"is_verified": true,
"is_disabled": false,
"is_deactivated": false,
"can_reauthenticate": true,
"standard_attributes": {
"email": "user@example.com",
"email_verified": true,
"preferred_username": "user01",
"updated_at": 1136171045
}
},
"identity": {
"id": "38683500-f6ce-477d-b944-1f915a451995",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"type": "login_id",
"claims": {
"https://authgear.com/claims/login_id/key": "username",
"https://authgear.com/claims/login_id/original_value": "user01",
"https://authgear.com/claims/login_id/type": "username",
"https://authgear.com/claims/login_id/value": "user01",
"preferred_username": "user01"
}
}
}
}
identity.username.removed¶
在从现有用户移除用户名时发生。用户可以在设置页面移除用户名,管理员也可以通过 Admin API 或管理台移除。
{
"type": "identity.username.removed",
"payload": {
"user": {
"id": "338deafa-400b-4589-a922-2c92d670b757",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"last_login_at": "2006-01-02T03:04:05.123456Z",
"is_anonymous": false,
"is_verified": true,
"is_disabled": false,
"is_deactivated": false,
"can_reauthenticate": true,
"standard_attributes": {
"email": "user@example.com",
"email_verified": true,
"updated_at": 1136171045
}
},
"identity": {
"id": "38683500-f6ce-477d-b944-1f915a451995",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"type": "login_id",
"claims": {
"https://authgear.com/claims/login_id/key": "username",
"https://authgear.com/claims/login_id/original_value": "user02",
"https://authgear.com/claims/login_id/type": "username",
"https://authgear.com/claims/login_id/value": "user02",
"preferred_username": "user02"
}
}
}
}
identity.username.updated¶
在用户名更新时发生。用户可以在设置页面更新用户名。
{
"type": "identity.username.updated",
"payload": {
"user": {
"id": "338deafa-400b-4589-a922-2c92d670b757",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"last_login_at": "2006-01-02T03:04:05.123456Z",
"is_anonymous": false,
"is_verified": true,
"is_disabled": false,
"is_deactivated": false,
"can_reauthenticate": true,
"standard_attributes": {
"email": "user@example.com",
"email_verified": true,
"preferred_username": "user02",
"updated_at": 1136171045
}
},
"new_identity": {
"id": "38683500-f6ce-477d-b944-1f915a451995",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"type": "login_id",
"claims": {
"https://authgear.com/claims/login_id/key": "username",
"https://authgear.com/claims/login_id/original_value": "user02",
"https://authgear.com/claims/login_id/type": "username",
"https://authgear.com/claims/login_id/value": "user02",
"preferred_username": "user02"
}
},
"old_identity": {
"id": "38683500-f6ce-477d-b944-1f915a451995",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"type": "login_id",
"claims": {
"https://authgear.com/claims/login_id/key": "username",
"https://authgear.com/claims/login_id/original_value": "user01",
"https://authgear.com/claims/login_id/type": "username",
"https://authgear.com/claims/login_id/value": "user01",
"preferred_username": "user01"
}
}
}
}
identity.oauth.connected¶
在用户连接新的 OAuth 提供方时发生。
{
"type": "identity.oauth.connected",
"payload": {
"user": {
"id": "338deafa-400b-4589-a922-2c92d670b757",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"last_login_at": "2006-01-02T03:04:05.123456Z",
"is_anonymous": false,
"is_verified": true,
"is_disabled": false,
"is_deactivated": false,
"can_reauthenticate": true,
"standard_attributes": {
"email": "user@example.com",
"email_verified": true,
"updated_at": 1136171045
}
},
"identity": {
"id": "f22425cf-68b2-45f8-936d-3c54c9cdf5c7",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"type": "oauth",
"claims": {
"email": "xxx@gmail.com",
"email_verified": true,
"family_name": "",
"given_name": "",
"https://authgear.com/claims/oauth/profile": {
"at_hash": "",
"aud": ["xxx.apps.googleusercontent.com"],
"azp": "xxx.apps.googleusercontent.com",
"email": "xxx@gmail.com",
"email_verified": true,
"exp": "2006-01-02T03:04:05Z",
"family_name": "",
"given_name": "",
"iat": "2006-01-02T03:04:05Z",
"iss": "https://accounts.google.com",
"locale": "en",
"name": "",
"nonce": "",
"picture": "https://lh3.googleusercontent.com/a/xxx",
"sub": ""
},
"https://authgear.com/claims/oauth/provider_alias": "google",
"https://authgear.com/claims/oauth/provider_type": "google",
"https://authgear.com/claims/oauth/subject_id": "",
"locale": "en",
"name": "",
"picture": "https://lh3.googleusercontent.com/a/xxx"
}
}
}
}
identity.oauth.disconnected¶
在用户与某个 OAuth 提供方断开连接时发生。用户可以在设置页面断开与 OAuth 提供方的连接,管理员也可以通过 Admin API 或管理台移除该 OAuth 身份。
{
"type": "identity.oauth.disconnected",
"payload": {
"user": {
"id": "338deafa-400b-4589-a922-2c92d670b757",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"last_login_at": "2006-01-02T03:04:05.123456Z",
"is_anonymous": false,
"is_verified": true,
"is_disabled": false,
"is_deactivated": false,
"can_reauthenticate": true,
"standard_attributes": {
"email": "user@example.com",
"email_verified": true,
"updated_at": 1136171045
}
},
"identity": {
"id": "f22425cf-68b2-45f8-936d-3c54c9cdf5c7",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"type": "oauth",
"claims": {
"email": "xxx@gmail.com",
"email_verified": true,
"family_name": "",
"given_name": "",
"https://authgear.com/claims/oauth/profile": {
"at_hash": "",
"aud": ["xxx.apps.googleusercontent.com"],
"azp": "xxx.apps.googleusercontent.com",
"email": "xxx@gmail.com",
"email_verified": true,
"exp": "2006-01-02T03:04:05Z",
"family_name": "",
"given_name": "",
"iat": "2006-01-02T03:04:05Z",
"iss": "https://accounts.google.com",
"locale": "en",
"name": "",
"nonce": "",
"picture": "https://lh3.googleusercontent.com/a/xxx",
"sub": ""
},
"https://authgear.com/claims/oauth/provider_alias": "google",
"https://authgear.com/claims/oauth/provider_type": "google",
"https://authgear.com/claims/oauth/subject_id": "",
"locale": "en",
"name": "",
"picture": "https://lh3.googleusercontent.com/a/xxx"
}
}
}
}
identity.biometric.enabled¶
在用户启用生物识别登录时发生。
{
"type": "identity.biometric.enabled",
"payload": {
"user": {
"id": "338deafa-400b-4589-a922-2c92d670b757",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"last_login_at": "2006-01-02T03:04:05.123456Z",
"is_anonymous": false,
"is_verified": true,
"is_disabled": false,
"is_deactivated": false,
"can_reauthenticate": true,
"standard_attributes": {
"email": "user@example.com",
"email_verified": true,
"updated_at": 1136171045
}
},
"identity": {
"id": "5cb77960-634b-4c0e-8a0e-6c2c73fb8f47",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"type": "biometric",
"claims": {
"https://authgear.com/claims/biometric/device_info": {
"ios": {
"NSBundle": {
"CFBundleDisplayName": "Authgear demo iOS",
"CFBundleExecutable": "ios_example",
"CFBundleIdentifier": "com.authgear.exampleapp.ios",
"CFBundleName": "ios_example",
"CFBundleShortVersionString": "1.0",
"CFBundleVersion": "1653565975"
},
"NSProcessInfo": {
"isMacCatalystApp": false,
"isiOSAppOnMac": false
},
"UIDevice": {
"model": "iPhone",
"name": "iPhone",
"systemName": "iOS",
"systemVersion": "16.1.1",
"userInterfaceIdiom": "phone"
},
"uname": {
"machine": "iPhone13,3",
"nodename": "Users-iPhone",
"release": "22.1.0",
"sysname": "Darwin",
"version": "Darwin Kernel Version 22.1.0: Thu Oct 6 19:34:22 PDT 2022; root:xnu-8792.42.7~1/RELEASE_ARM64_T8101"
}
}
},
"https://authgear.com/claims/biometric/formatted_device_info": "iPhone 12 Pro",
"https://authgear.com/claims/biometric/key_id": "1CC9D95A-6578-4557-8279-C4D5699D3549"
}
}
}
}
identity.biometric.disabled¶
在生物识别登录被禁用时发生。仅当用户在设置页面禁用该功能,或管理员通过 Admin API 或管理台禁用该功能时才会触发。
{
"type": "identity.biometric.disabled",
"payload": {
"user": {
"id": "338deafa-400b-4589-a922-2c92d670b757",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"last_login_at": "2006-01-02T03:04:05.123456Z",
"is_anonymous": false,
"is_verified": true,
"is_disabled": false,
"is_deactivated": false,
"can_reauthenticate": true,
"standard_attributes": {
"email": "user@example.com",
"email_verified": true,
"updated_at": 1136171045
}
},
"identity": {
"id": "5cb77960-634b-4c0e-8a0e-6c2c73fb8f47",
"created_at": "2006-01-02T03:04:05.123456Z",
"updated_at": "2006-01-02T03:04:05.123456Z",
"type": "biometric",
"claims": {
"https://authgear.com/claims/biometric/device_info": {
"ios": {
"NSBundle": {
"CFBundleDisplayName": "Authgear demo iOS",
"CFBundleExecutable": "ios_example",
"CFBundleIdentifier": "com.authgear.exampleapp.ios",
"CFBundleName": "ios_example",
"CFBundleShortVersionString": "1.0",
"CFBundleVersion": "1653565975"
},
"NSProcessInfo": {
"isMacCatalystApp": false,
"isiOSAppOnMac": false
},
"UIDevice": {
"model": "iPhone",
"name": "iPhone",
"systemName": "iOS",
"systemVersion": "16.1.1",
"userInterfaceIdiom": "phone"
},
"uname": {
"machine": "iPhone13,3",
"nodename": "Users-iPhone",
"release": "22.1.0",
"sysname": "Darwin",
"version": "Darwin Kernel Version 22.1.0: Thu Oct 6 19:34:22 PDT 2022; root:xnu-8792.42.7~1/RELEASE_ARM64_T8101"
}
}
},
"https://authgear.com/claims/biometric/formatted_device_info": "iPhone 12 Pro",
"https://authgear.com/claims/biometric/key_id": "1CC9D95A-6578-4557-8279-C4D5699D3549"
}
}
}
}
对象参考¶
事件中可能包含不同的对象。您可以参考下方内容了解它们的属性。
用户对象¶
"payload":{
"user": {
"id": "string",
"created_at": "timestamp",
"updated_at": "timestamp",
"last_login_at": "timestamp",
"is_anonymous": boolean,
"is_verified": boolean,
"is_disabled": boolean,
"is_deactivated": boolean,
"can_reauthenticate": boolean,
"standard_attributes": {
...
},
"custom_attributes": {
...
}
}
}