简体   繁体   English

Azure B2C Web 应用程序和本地移动

[英]Azure B2C For Both Web Apps and Native Mobile

I am sure this scenario must be supported, but I cannot find examples of how to do it.我确信这种情况必须得到支持,但我找不到如何做到这一点的例子。

I have a .NET Core Web App that uses Azure AD B2C with custom html pages for signup, signin, profile edit, etc.我有一个 .NET 核心 Web 应用程序,它使用 Azure AD B2C 和自定义 html 页面进行注册、登录、个人资料编辑等。

I would like to create some iOS and Android apps that interact with the same B2C tenant but provide their own native screens and just interact B2C from business logic.我想创建一些 iOS 和 Android 应用程序,它们与同一个 B2C 租户交互,但提供它们自己的本机屏幕,并且只从业务逻辑与 B2C 交互。

Would the native apps just have to use the Microsoft Graph to log users in, reset passwords, edit profile, etc?本机应用程序是否只需要使用 Microsoft Graph 来登录用户、重置密码、编辑配置文件等? Or can they use MSAL libraries (but not use the custom html pages defined in the policy flows) to drive their native authentication screens?或者他们可以使用 MSAL 库(但不使用策略流中定义的自定义 html 页面)来驱动他们的本机身份验证屏幕吗?

• They can surely use the MSAL libraries through various platforms in which the application code for the android and iOS apps is written, ie, in Java and Kotlin . • 他们肯定可以通过编写android 和iOS 应用程序代码的各种平台使用MSAL 库,即在JavaKotlin中。 Also, MSAL libraries call 'com.microsoft.identity.client' as a dependency for initiating and incorporating Azure AD B2C identity and authorization through the application that makes an interactive authorization request callback.此外,MSAL 库调用“com.microsoft.identity.client”作为依赖项,以通过应用程序启动和合并 Azure AD B2C 身份和授权,从而进行交互式授权请求回调。 Please find the documentation link below and the code snippet from it which displays the use of MSAL libraries for authentication purposes.请在下面找到文档链接和其中显示使用 MSAL 库进行身份验证的代码片段。

This is the file code snippet to be added in the 'AndroidManifest.xml' file: -这是要添加到“AndroidManifest.xml”文件中的文件代码片段:-

  ‘ <!--Intent filter to capture System Browser or Authenticator calling back to our app after sign-in-->
    <activity
android:name="com.microsoft.identity.client.BrowserTabActivity">
    <intent-filter>
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
    <data android:scheme="msauth"
        android:host="Package_Name"
        android:path="/Signature_Hash" />
</intent-filter>
  </activity> ‘

Redirect URI: -重定向 URI:-

‘ msauth://com.azuresamples.msalandroidapp/1wIqXSqBj7w%2Bh11ZifsnqwgyKrY%3D ’

• Please find below the link for Microsoft documentation that clearly states the use of MSAL libraries for authentication with Azure AD B2C: - • 请在下方找到 Microsoft 文档的链接,其中明确说明了使用MSAL 库对 Azure AD B2C 进行身份验证:-

https://learn.microsoft.com/en-us/azure/active-directory-b2c/enable-authentication-android-app?tabs=java https://learn.microsoft.com/en-us/azure/active-directory-b2c/enable-authentication-android-app?tabs=java

https://learn.microsoft.com/en-us/azure/active-directory-b2c/configure-authentication-sample-android-app?tabs=kotlin#step-5-configure-the-sample-mobile-app https://learn.microsoft.com/en-us/azure/active-directory-b2c/configure-authentication-sample-android-app?tabs=kotlin#step-5-configure-the-sample-mobile-app

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM