api.auth

概览

本届会议及其背后的概况。 三种方法——这里没有签名,因为 SDK 使用密钥认证 。

3 methodssession-scopedfree
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

使用电子邮件和密码签名属于账户表面,而不是 SDK:程序持有密钥,而不是密码。这里是程序需要什么——结束这段会话,结束另一段会话,改变它所属的配置。

方法

方法功能返回值
logout()结束客户端使用的会话 。{OK: 真实}
撤销( id) 续号结束同一账户的另一会话, 依 ID 结束 。~ OK:真实 ~ ~ ~ 404 ~
更新Profile( 更新)更改可写化的剖析档字段 。{好的,用户}

关键, 会议, 请求

三个事物处于你的代码和答案之间,每个事物都被废除。知道你们手里的是什么,这资源的大部分就是知道。

说明结束时间
键键向您的程序发布的账户是什么 。你撤销了它
会议 届会钥匙是交换的退出(), 撤销会议( S), 或者过期 。
象征性每项请求的短命证据有效期结束,会议续延。
相会和关键是两件事

结束会话不会停止密钥 : 下次调用时再次交换它, 您又返回了, 在新的会话下。 要切换访问权限, 请取消密钥 。

哪里不在这里 哪里不在这里

想要什么何处
此密钥属于谁api.getUser()
本届会议的哪届会议api.session()
停止一个密钥工作api.keys.revoke(id)
余额和计划api.getUser()
签名时签名带有电子邮件和密码非 a SDK 操作。您的账户表面可以操作 。

三个选择

// This process should stop being this session
await api.auth.logout();

// That machine over there should be signed out
await api.auth.revokeSession(itsSessionId);

// That machine should not be able to come back at all
await api.keys.revoke(itsKeyId);

// All of the above, for a machine you no longer trust:
await api.keys.revoke(itsKeyId);
await api.auth.revokeSession(itsSessionId);
# This process should stop being this session
api.auth.logout()

# That machine over there should be signed out
api.auth.revoke_session(its_session_id)

# That machine should not be able to come back at all
api.keys.revoke(its_key_id)

# All of the above, for a machine you no longer trust:
api.keys.revoke(its_key_id)
api.auth.revoke_session(its_session_id)

顺序是故意的。 取消键先关闭门; 取消会话后将已经进去的人移走。 反之, 绕着键的窗口, 键用来交换新的会话 。