問題描述
我在 .net core (3.1) 中有一個 web api.
I' ve a web api in .net core (3.1).
這個網站被 3 個應用程序使用:
This web is used by 3 applications :
- 網絡應用程序
- iOS 應用
- 安卓應用
對于 Web 應用程序,我們使用默認登錄頁面.所以登錄后會有一個重定向到客戶端應用程序.
For the Web Application we use the default login page. so after login there is a redirect to the client application.
對于 Ios 和 Android 應用,我們無法找到可用于獲取令牌的代碼.
For Ios and Android Apps we are not able to find a code that worked in order to get the token.
謝謝.
推薦答案
關于如何獲取 azure ad token 調用 api 的示例有很多.請看這里:https://docs.microsoft.com/en-us/azure/active-directory-b2c/code-samples
there are various samples of how to get azure ad tokens to call apis. please take a look here: https://docs.microsoft.com/en-us/azure/active-directory-b2c/code-samples
特別注意前2個:ios-swift-native-msal和android-native-msal他們基本上就是這樣做的,使用 MSAL 庫來獲取令牌并允許您使用它來調用 Web api.
pay particular attention to the first 2: ios-swift-native-msal and android-native-msal they basically do exactly that, with the MSAL library to get tokens and allow you to use it to call web apis.
這篇關于如何將移動應用程序連接到 AD B2C的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!