azure-active-directory - AdalServiceException : The application needs access to a service that your organization has not subscribed to

标签 azure-active-directory adal

我们正在尝试使用我们拥有并在 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/

相关文章:

javascript - Active Directory 注销而不重定向到 Angular 2 中的默认 Microsoft 注销页面

Azure B2C - 无法静默获取 token

c# - 在 C# REST 服务中验证 ADAL JWT token

c# - 使用 asp.net Identity 进行 Azure AD 身份验证以进行授权

azure - 无法使用 Graph API 删除 Azure B2C 中的用户

azure - 在常规 Azure AD 租户内创建 Azure AD B2C 应用程序注册的目的是什么?

powershell - 使用 Powershell 获取 Azure AD token (jwt)

azure - "Content not available"Power BI 嵌入带有 azure 身份验证 token 的 ionic 应用程序

node.js - 如何使用 ADAL 和 MFA 登录 AAD

asp.net - Microsoft Graph API .NET - 能够拉取所有用户(包括我自己),但不仅仅是我