我想知道是否有任何方法可以通过API重置登录cookie。
我知道如何通过管理中的设置来做到这一点。
切换changePasswordAtNextLogin
G Suite 用户的标记将其从所有设备中注销。
使changePasswordAtNextLogin
价值True
进而False
立即地。这比暂停用户要好,因为传入的邮件不会被退回。
Python 示例:
def changePasswordNextLogin(self,userEmail, status=True):
try:
reqBody = {"changePasswordAtNextLogin":status}
updateStatus = self.service.users().update(userKey=userEmail,body=reqBody).execute()
return True
except Exception, e:
logging.info("Exception change_passwordNextLogin = %s", e)
return False
def forceLogoutUser(self, userEmail):
self.changePasswordNextLogin(userEmail, True)
self.changePasswordNextLogin(userEmail, False)
return True
当您想要从所有设备中注销用户时,请调用“强制注销用户(用户电子邮件)”。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)