簡體   English   中英

Azure B2C Web 應用程序和本地移動

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

我確信這種情況必須得到支持,但我找不到如何做到這一點的例子。

我有一個 .NET 核心 Web 應用程序,它使用 Azure AD B2C 和自定義 html 頁面進行注冊、登錄、個人資料編輯等。

我想創建一些 iOS 和 Android 應用程序,它們與同一個 B2C 租戶交互,但提供它們自己的本機屏幕,並且只從業務邏輯與 B2C 交互。

本機應用程序是否只需要使用 Microsoft Graph 來登錄用戶、重置密碼、編輯配置文件等? 或者他們可以使用 MSAL 庫(但不使用策略流中定義的自定義 html 頁面)來驅動他們的本機身份驗證屏幕嗎?

• 他們肯定可以通過編寫android 和iOS 應用程序代碼的各種平台使用MSAL 庫,即在JavaKotlin中。 此外,MSAL 庫調用“com.microsoft.identity.client”作為依賴項,以通過應用程序啟動和合並 Azure AD B2C 身份和授權,從而進行交互式授權請求回調。 請在下面找到文檔鏈接和其中顯示使用 MSAL 庫進行身份驗證的代碼片段。

這是要添加到“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> ‘

重定向 URI:-

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

• 請在下方找到 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/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