Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Azure AD SingleSignOn出现错误_C#_Asp.net_Azure - Fatal编程技术网

C# Azure AD SingleSignOn出现错误

C# Azure AD SingleSignOn出现错误,c#,asp.net,azure,C#,Asp.net,Azure,我订阅了azure,并且已经开发了一个应用程序,我正在尝试使用azure AD作为身份验证机制 我在Azure中创建了应用程序,添加了Azure AD作为身份验证机制,当我尝试登录时,出现了此错误 AADSTS65005:应用程序需要访问服务 (“”)您的组织 “123-32323-323232-3233”尚未订阅或启用。联系您的 IT管理员可以查看服务订阅的配置 这是我的创业课 public partial class Startup { private static string

我订阅了azure,并且已经开发了一个应用程序,我正在尝试使用azure AD作为身份验证机制

我在Azure中创建了应用程序,添加了Azure AD作为身份验证机制,当我尝试登录时,出现了此错误

AADSTS65005:应用程序需要访问服务 (“”)您的组织 “123-32323-323232-3233”尚未订阅或启用。联系您的 IT管理员可以查看服务订阅的配置

这是我的创业课

public partial class Startup
{

    private static string clientId = ConfigurationManager.AppSettings["ida:ClientId"];
    private static string aadInstance = ConfigurationManager.AppSettings["ida:AADInstance"];
    private static string tenant = ConfigurationManager.AppSettings["ida:Tenant"];
    private static string postLogoutRedirectUri = ConfigurationManager.AppSettings["ida:PostLogoutRedirectUri"];

    string authority = String.Format(CultureInfo.InvariantCulture, aadInstance, tenant);

    public void ConfigureAuth(IAppBuilder app)
    {
        app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);

        app.UseCookieAuthentication(new CookieAuthenticationOptions());

        app.UseOpenIdConnectAuthentication(
            new OpenIdConnectAuthenticationOptions
            {
                ClientId = clientId,
                Authority = authority,
                PostLogoutRedirectUri = postLogoutRedirectUri,
                RedirectUri = postLogoutRedirectUri,
                Notifications = new OpenIdConnectAuthenticationNotifications
                {
                    AuthenticationFailed = context => 
                    {
                        context.HandleResponse();
                        context.Response.Redirect("/Error?message=" + context.Exception.Message);
                        return Task.FromResult(0);
                    }
                }
            });
    }
}
有什么想法吗

编辑1:

从我所需的权限中删除某些应用程序后,该应用程序似乎已被删除,但现在我收到此错误

编辑2:


再次删除和添加权限后修复。

您似乎是在使用基于服务(“”)的公共数据服务进行开发。请确保您的组织没有订阅服务(“”)

请注意公共数据服务的先决条件:

  • 如果您已经注册了PowerApps,则可以转到PowerApps并登录。如果您尚未注册,可以按照以下说明注册
  • 确保您对包含公共数据服务数据库的环境具有管理员访问权限。转到PowerApps门户,单击页面右上角的gear图标,然后单击管理中心。如果您没有对任何包含数据库的环境的管理员访问权限,请按照以下说明创建数据库
  • 下面是帮助您入门的有用文档:


    谢谢,这是我的第一篇帖子。在发布问题之前,你应该先阅读一下