2015-02-05 116 views
3

我尝试2个教程Azure的移动服务 - 社会登录后创建新帐户

  1. 自定义身份验证提供http://azure.microsoft.com/blog/2014/07/28/azure-mobile-services-net-updates/结合

  2. 自定义验证http://azure.microsoft.com/en-us/documentation/articles/mobile-services-dotnet-backend-get-started-custom-authentication/

我想创建一个新的用户帐户与LinkedInLoginProvider(从1教程),就像它使用CustomLoginProvider(从2教程)完成。

我的问题是 - 如何使用默认owin登录管道外部登录集成和在那里我必须写我

Account newAccount = new Account 
       { 
        ... 
       }; 
context.Accounts.Add(newAccount); 

代码。

我是否需要创建新的CustomRegistrationLinkedInController?

以及如何实现它?

有人能告诉我任何例子吗?

回答

0

来自Microsoft的Matthew Henderson解决了我的问题 - “在这种情况下,我会挂接到您的LinkedInLoginProvider的CreateCredentials()方法。这是一种在每次登录后都会在运行时验证身份,但是在一个令牌被发布之前,在这里你可以检查记录是否已经存在,如果没有创建,你实际上在这个方法中获得了UserID作为教程的一部分。

相关问题