目前,我正在尝试从 AAD(这是一个 native 应用程序)获取不记名 token 。我有当前的代码块
private AuthenticationContext authContext = null;
authContext.AcquireTokenAsync(todoListResourceId, clientId, redirectUri, new PlatformParameters(PromptBehavior.Always))
那么在当前代码块中,todoListResourceId 是什么?
最佳答案
这是您想要访问 token 的 API 的资源标识符。 在这种情况下,您的客户端应用程序会对 Azure AD 说“给我一个待办事项列表服务的 token ”。
对于 MS API,您通常使用 URI,例如:
- MS Graph API:
https://graph.microsoft.com
- Azure AD 图形 API:
https://graph.windows.net
如果是您自己的 API,您可以使用 API 客户端 ID 或应用程序 ID URI(可在应用程序注册的属性中找到)。 尽管它确实需要将 API 配置为接受两者作为有效受众。 如果它只接受一个,那么您必须使用那个。
关于azure - 这里的ResourceId是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50412203/