問題描述
我在 .net core (3.1) 中有一個(gè) web api.
I' ve a web api in .net core (3.1).
這個(gè)網(wǎng)站被 3 個(gè)應(yīng)用程序使用:
This web is used by 3 applications :
- 網(wǎng)絡(luò)應(yīng)用程序
- iOS 應(yīng)用
- 安卓應(yīng)用
對(duì)于 Web 應(yīng)用程序,我們使用默認(rèn)登錄頁面.所以登錄后會(huì)有一個(gè)重定向到客戶端應(yīng)用程序.
For the Web Application we use the default login page. so after login there is a redirect to the client application.
對(duì)于 Ios 和 Android 應(yīng)用,我們無法找到可用于獲取令牌的代碼.
For Ios and Android Apps we are not able to find a code that worked in order to get the token.
謝謝.
推薦答案
關(guān)于如何獲取 azure ad token 調(diào)用 api 的示例有很多.請(qǐng)看這里: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個(gè):ios-swift-native-msal和android-native-msal他們基本上就是這樣做的,使用 MSAL 庫來獲取令牌并允許您使用它來調(diào)用 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.
這篇關(guān)于如何將移動(dòng)應(yīng)用程序連接到 AD B2C的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!