简体   繁体   English

使用LiveSDK通过Azure移动服务身份验证处理用户密码更改事件

[英]Handling user password change event with Azure mobile services authentication with LiveSDK

we have successfully implemented Azure mobile services authentication to all our applications (Web, Xamain.iOS, Xamarin.Android, Windows 8, Windows Phone, WPF even).We can authenticate against Google , Microsoft and Azure Active Directory without any trouble using tutorials from MS site. 我们已经成功地对所有应用程序(Web,Xamain.iOS,Xamarin.Android,Windows 8,Windows Phone,甚至WPF)实施了Azure移动服务身份验证。我们可以使用Google的教程对Google,Microsoft和Azure Active Directory进行身份验证而没有任何麻烦MS网站。 On all platforms we have autologin, implemented again based on tutorials and stack owerflow. 在所有平台上,我们都有自动登录功能,并根据教程和堆栈流通量再次实现。

Problem is, that when user change his password in any of services, i would expect that it will cause premature expiration of token, or something like that, forcing applications to request user login informations again. 问题是,当用户在任何服务中更改其密码时,我希望它会导致令牌或类似内容的过早失效,从而迫使应用程序再次请求用户登录信息。 But this is just not happening, we were expecting that it would be handled by provided classes. 但这只是没有发生,我们期望它将由提供的类来处理。

So my question is, how to be able to handle change of user password (or deleting of account) before expiration of token that is stored locally. 所以我的问题是,如何能够在本地存储的令牌到期之前处理用户密码的更改(或删除帐户)。

Mobile Services only relies on the OAuth token being valid when it first logs the user in. It's up to the service how ofter to validate that that token is still valid. 移动服务仅在OAuth令牌首次登录时才有效。这取决于服务如何验证该令牌仍然有效。

Basically, if you want to validate, before each call, whether the user is still valid, just ping Google and see if it works. 基本上,如果您想在每次通话前验证用户是否仍然有效,只需ping Google并查看其是否有效。 If it doesn't, log the user out. 如果不是,请注销用户。 If Google doesn't invalidate tokens based on password change, but does expose some sort of event for password changes, you'd have to include that in your logic as well. 如果Google不会基于密码更改使令牌无效,但确实公开了一些密码更改事件,则您也必须在逻辑中包括该事件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM