简体   繁体   English

如何在不使用Microsoft页面的情况下在Azure AD B2C中使用graph api进行社交登录?

[英]How to use graph api for social login in Azure AD B2C without using Microsoft page?

I am creating an application that uses Azure AD B2C for authorization where I'm not going to use Microsoft's login page. 我正在创建一个使用Azure AD B2C进行授权的应用程序,而我将不使用Microsoft的登录页面。 Here in this customized login page, I want to use social login. 在此自定义的登录页面中,我要使用社交登录。

I have already done login for Azure AD B2C registered user using Graph Api(RPOC User flow). 我已经使用图形Api(RPOC用户流)为Azure AD B2C注册用户完成了登录。 I need to do the same for the social network user login. 我需要对社交网络用户登录执行相同的操作。

POST https://MyApplication.b2clogin.com/MyApplication.onmicrosoft.com/oauth2/v2.0/token?p=b2c_1_test_rpoc 开机自检https://MyApplication.b2clogin.com/MyApplication.onmicrosoft.com/oauth2/v2.0/token?p=b2c_1_test_rpoc

BODY

username:******
password:******
grant_type:password
scope: ********
client_id: *******
response_type:token id_token

RESPONSE

{
   "access_token":,
   "token_type":,
   "expires_in":,
   "refresh_token":,
   "id_token":
}

Is there any such kind of graph API or any way we can get token from Azure AD B2C for social network user login. 是否有任何这种图形API或我们可以从Azure AD B2C获取令牌以进行社交网络用户登录的任何方式。

It might be possible to implement it in a custom policy if the social IdP supports ROPC as well. 如果社交IdP也支持ROPC,则有可能在自定义策略中实现它。 There's a good chance they won't though. 他们很有可能不会。

B2C allows UI customization, so if you want a custom login page, it'd be better to use that instead of ROPC. B2C允许UI自定义,因此,如果您要自定义登录页面,最好使用该页面而不是ROPC。

The closest you can achieve is to place a Facebook button in your native app which launches the B2C policy with a domaim_hint parameter attached such that B2C auto redirects the user to Facebook. 您可以实现的最接近的做法是在您的本机应用程序中放置一个Facebook按钮,该按钮将启动B2C策略,并附加一个domaim_hint参数,以便B2C自动将用户重定向到Facebook。 The entire flow still has to be in a web view. 整个流程仍必须在Web视图中。 Social IdPs like Facebook don't support ROPC. 像Facebook这样的社交IdP不支持ROPC。

https://docs.microsoft.com/en-us/azure/active-directory-b2c/direct-signin https://docs.microsoft.com/zh-CN/azure/active-directory-b2c/direct-signin

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

相关问题 Xamarin Azure AD B2C登录,卡在登录页面 - Xamarin Azure AD B2C login, stuck at login page 使用 Microsoft Graph + Http 客户端更改 Azure AD B2C 上的用户密码 - Change user password on Azure AD B2C using Microsoft Graph + Http Client 在Azure AD B2C中使用Microsoft.Graph SDK创建本地帐户 - Create local account using Microsoft.Graph SDK in Azure AD B2C 如何以编程方式通过 Microsoft Graph 获取 Azure AD b2c 登录日志 - how to get Azure AD b2c sign-in logs through Microsoft Graph programatically 带有 B2C AD 的 Azure Graph - Azure Graph with B2C AD 如何在没有Graph API的C#Azure B2C身份验证中获取当前登录用户的用户名和电子邮件地址? - How to get current login user's username & email address in C# Azure B2C authentication without Graph API? 使用用户分配的托管标识访问 Azure AD B2C 和 MS Graph API - Access Azure AD B2C with MS Graph API using User-Assigned Managed Identity Microsoft graph 更改 azure ad b2c 用户密码不起作用 - Microsoft graph change azure ad b2c user password not working Microsoft Graph SDK 未返回 Azure AD B2C 用户的自定义属性值 - Microsoft Graph SDK not returning Custom attributes values of Azure AD B2C Users 使用图形 API 登录 Azure B2C - Azure B2C sign in using Graph API
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM