我们正在尝试使用我们拥有并在 Azure AD 中注册的应用程序对我们的一位客户进行身份验证。但是,客户在执行身份验证请求时收到此错误:
Microsoft.IdentityModel.Clients.ActiveDirectory.AdalServiceException: AADSTS50000: There was an error issuing a token. AADSTS65005: The application needs access to a service that your organization
<name_of_company>
has not subscribed to. Please contact your Administrator to review the configuration of your service subscriptions.
Trace ID: e8746b39-33c6-4a4c-8608-906613fe73a9
Correlation ID: 14618bd8-b58e-4301-a269-510ff22cb600
Timestamp: 2016-12-20 13:07:46Z
我们的身份验证方法基本上是这样的:
AuthenticationContext commonAuthContext = new AuthenticationContext("https://login.microsoftonline.com/common");
AuthenticationResult result = await commonAuthContext.AcquireTokenAsync("https://management.core.windows.net/",
_clientId, _replyUrl,
new PlatformParameters(PromptBehavior.Always));
我们的 AAD 应用程序位于 microsoft.com 目录中,名称为:
cisnativeinstaller [启用 wsfed]
谢谢 杰夫
最佳答案
当我们开发需要订阅服务(例如 Office 365 Exchange Online)的应用程序时。当没有订阅的用户尝试向应用程序授予同意时,会发生此错误。
要解决此问题,用户需要先分配相应的许可证,然后才能授予应用程序同意。
或者您可能开发多层应用程序,在这种情况下,我们需要将客户端应用程序添加到服务应用程序knownClientApplications。请参阅以下有关此场景的链接:
How to sign in any Azure Active Directory (AD) user using the multi-tenant application pattern (同意和多层应用程序部分)
关于azure-active-directory - AdalServiceException : The application needs access to a service that your organization has not subscribed to,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41248138/