如何实现连接到Microsoft Azure AD B2C的本机自定义登录(和注册)屏幕?
这是设置:
Microsoft提供的解决方案可以在这里找到:https://github.com/Azure-Samples/active-directory-b2c-ios-swift-native-msal。但这会打开一个safari窗口,这不是我想要的用户体验:
相反,我想用自己的布局和设计来构建本机登录屏幕(UIViewController),但仍想使用Azure Active Directory B2C。
这怎么办?
答案 0 :(得分:0)
For sign-in, you can implement a native page that integrates with a resource owner password credentials policy in the Azure AD B2C tenant, which will enable a user's credentials to be POST
ed to the Azure AD B2C tenant for validation:
POST /tfp/yourtenant.onmicrosoft.com/B2C_1_ROPC_Auth/oauth2/v2.0/token HTTP/1.1
Host: yourtenant.b2clogin.com
Content-Type: application/x-www-form-urlencoded
grant_type=password&
username=leadiocl%40trashmail.ws&
password=Passxword1&
scope=openid+bef22d56-552f-4a5b-b90a-1988a7d634ce+offline_access
client_id=bef22d56-552f-4a5b-b90a-1988a7d634ce&
response_type=token+id_token
For sign-up, a client credential is required to request an access token for the Azure AD Graph API to create an Azure AD B2C user, so if you are wanting to implement a native page then you will have to consider also implementing a backend/proxy API that protects the client credential.