简体   繁体   English

结合使用AWS和Xamarin进行永久登录

[英]Persistent Sign In Using AWS with Xamarin

I am using the AWSSDK Nuget packages in my Xamarin mobile app (c#). 我在Xamarin移动应用程序(c#)中使用AWSSDK Nuget软件包。 I authenticate the user and get back AccessToken, RefreshToken, IdToken, etc.. but if the user closes the app without signing out, how can I retrieve those tokens? 我对用户进行身份验证,然后取回AccessToken,RefreshToken,IdToken等。但是,如果用户关闭应用程序但未注销,则如何检索这些令牌?

The AWS docs for Xamarin seem to be pretty much non-existent. Xamarin的AWS文档似乎几乎不存在。 I have been using the docs for .Net as a resource, but it doesn't mention anything about persistent sign ins. 我一直在使用.Net的文档作为资源,但是它没有提及有关持久登录的任何内容。

Do I need to take it upon myself to store the tokens on the device locally? 我是否需要自己将令牌存储在本地设备上? If so, what are the best practices for this? 如果是这样,最佳做法是什么?

Try the Xamarin.Auth . 尝试Xamarin.Auth It has the code to securely store the tokens on the client device. 它具有用于将令牌安全存储在客户端设备上的代码。 As long as the source code is available, you can either use the library as a cross-platform account store or just grab the code to store data for each platform: 只要源代码可用,您就可以将该库用作跨平台帐户存储,也可以仅获取代码以存储每个平台的数据:

iOS Account Store iOS帐户商店

Android Account Store Android帐户商店

WinRT Account Store WinRT帐户存储

UWP Account Store UWP帐户存储

The library is regularly updated and maintained. 该库会定期更新和维护。 Consider joining the Xamarin Slack chat for quick technical answers. 考虑加入Xamarin Slack聊天以获得快速的技术解答。

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

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