我需要为我的应用程序实现 B2C 登录和注册。我已使用以下链接从 GitHub 下载了代码。 https://github.com/Azure-Samples/active-directory-b2c-ios-swift-native-msal
这表明我需要一些常量来配置。
let kTenantName = "<tenant>.onmicrosoft.com" // Your tenant name
let kClientID = "<your-client-id>" // Your client ID from the portal when you created your application
let kSignupOrSigninPolicy = "<your-signin-policy>" // Your signup and sign-in policy you created in the portal
let kEditProfilePolicy = "<your-edit-profile-policy>" // Your edit policy you created in the portal
let kGraphURI = "<Your backend API>" // This is your backend API that you've configured to accept your app's tokens
let kScopes: [String] = ["<Your backend API>/demo.read"] // This is a scope that you've configured your backend API to look for.
现在我从哪里可以获得 kGraphURI 和 kScopes ?
最佳答案
对于此示例,您需要在 Azure B2C 应用程序中注册 Natvie App 和 Web API。
后端API是指在B2C应用程序中注册的WebApp/API。
kGraphURI = "<Your backend API>" // This is the App ID URI of Web API in the AAD B2C application.
kScopes: [String] = ["<Your backend API>/demo.read"] // This is a scope value which you configured for the Web API in the AAD B2C applicaiton.
例如:
kGraphURI = "https://fabrikamb2c.onmicrosoft.com/example"
kScopes: [String] = ["https://fabrikamb2c.onmicrosoft.com/example/demo.read"]
关于ios - 我将在哪里获得用于实现 Azure B2c 身份验证的 kGraphURI 和 kScopes,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50526270/