create user in azure active directory after login with facebook

二次信任 提交于 2019-12-24 18:44:09

问题


I have an azure mobile app (Xamarin android) that uses authentication/authorization with facebook, everything is setup and working on my mobile app, I’m able to authenticate with facebook and get an access token. with that access token I login in azure mobile services using the following code

MobileServiceClient Client;
var facebookToken = AccessToken.CurrentAccessToken.Token;
var token = new JObject();
token["access_token"] = facebookToken;
var user  = await Client.LoginAsync(MobileServiceAuthenticationProvider.Facebook, token);

I’m able to login and get an access token from azure mobile service. The problem I’m facing is that the above code does not create a user in the azure active directory.

How can I create the user in the azure active directory when the user is login with facebook?


回答1:


It does not make sense to add the Facebook user to Azure AD. Basically, they are two different identity providers. Azure AD enables you to securely sign in users with a Microsoft work or school account.

For your scenario, I'd recommend you save the user in the database after anyone that signed in. About how to do that you can check this out: Facebook Login Flow & Best Practices.



来源:https://stackoverflow.com/questions/47926786/create-user-in-azure-active-directory-after-login-with-facebook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!