将 ACS 与 Windows Phone 结合使用
我迷路了。我正在开发一个 Windows Phone 7 应用程序,我想要执行以下操作:
我想使用 Facebook、Live ID、Google 和 Yahoo 让用户登录我的应用程序。而且,如果他们没有任何这些帐户,我将需要在 Windows Azure 上实现注册界面。
我还需要存储登录我的应用程序的用户的一些 ID。例如,Facebook 返回该用户的 ID。但是 Google、Live ID 和 Yahoo!返回另一个 ID。我会将其存储在包含以下列的用户表中:
ID | Sing-IN-Type | ID-returned
ID:Primarty Key。
Sing-IN-Type:包含 Facebook、Google 等名称的表的外键。
ID-returned:这些网站返回的 ID。
我读过有关 ACS v2 的内容,但不确定它是否符合我的要求。你怎么认为?
I'm lost. I'm developing a Windows Phone 7 app and I want to do the following:
I want to use Facebook, Live ID, Google and Yahoo to let user sign in my app. And also, it they don't have any of those account I will need to implement a sign up interface on Windows Azure.
I also need to store some ID from user signed in my app. For example, Facebook returns an ID for that user. But Google, Live ID and Yahoo! returns another ID. I will store this on a user table with these columns:
ID | Sing-IN-Type | ID-returned
ID: Primarty Key.
Sing-IN-Type: Foreign key to a table with Facebook, Google, etc. names.
ID-returned: ID returned by those webs.
I've read about ACS v2 and I'm not sure it will fit with my requisites. What do you think?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
ACS 团队发布了一个示例,演示如何使用 silverlight 浏览器控件在电话应用程序中实现联合身份验证:
http://acs.codeplex.com/wikipage?title=ACS%20Windows%20Phone%20Sample&referringTitle=Samples
该示例不会解析要提取的令牌您所追求的声明,但不需要太多代码即可完成。
登录后,应用程序将从 ACS 返回的令牌缓存在 RequestSecurityTresponseStore 中,该存储是 MainPage 的成员。 DPE.OAuth 项目中包含可供您使用的简单 Web 令牌 (SWT) 处理程序。在 MainPage.xaml.cs 的上下文中,代码如下所示:
然后,您应该找到 ACS 在 swt.Parameters 内发出的 IdentityProvider(登录类型)和 NameIdentifier(用户 ID)声明。
如果您想在这种情况下托管自己的自定义登录页面,ACS 也提供了相应的功能:
http://msdn.microsoft.com/en-us/library/gg185963.aspx
The ACS team has posted a sample that demonstrates how to implement federated auth in a phone app using the silverlight browser control:
http://acs.codeplex.com/wikipage?title=ACS%20Windows%20Phone%20Sample&referringTitle=Samples
The sample doesn't parse the token to extract the claims you're after, but it wouldn't take much code to do it.
After logging in, the application caches the token returned from ACS in a RequestSecurityTresponseStore, which is a member of the MainPage. There are Simple Web Token (SWT) handlers included in the DPE.OAuth project that you can make use of. In the context of MainPage.xaml.cs, the code would look like this:
You should then find the IdentityProvider (sign in type) and NameIdentifier (user ID) claims that ACS issued inside the swt.Parameters.
If you want to host your own custom sign in page in this scenario, ACS provides functionality for that as well:
http://msdn.microsoft.com/en-us/library/gg185963.aspx
您还可以查看 来自身份框架的动手实验室。
You could also look at the hands on labs from the identity framework.