天蓝色广告签到重定向循环

S P*_*man 6 c# azure azure-active-directory asp.net-core

我正在开发一个供公司使用的内部应用程序,使用来自vs2017的模板,该模板启用了azure AD登录.

登录在本地工作正常 - 但是当部署到azure应用程序服务时 - 我可以进入azure广告的登录页面 - 但是当我输入我的凭据时 - 它只是点击重定向循环并最终出现错误.

有没有人有任何想法如何阻止这种情况发生?

来自Startup.cs的代码:

 public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
    {
        loggerFactory.AddConsole(Configuration.GetSection("Logging"));
        loggerFactory.AddDebug();

        if (env.IsDevelopment())
        {
            app.UseDeveloperExceptionPage();
            app.UseBrowserLink();
        }
        else
        {
            app.UseExceptionHandler("/Home/Error");
        }

        app.UseStaticFiles();

        app.UseCookieAuthentication();

        app.UseOpenIdConnectAuthentication(new OpenIdConnectOptions
        {
            ClientId = Configuration["Authentication:AzureAd:ClientId"],
            ClientSecret = Configuration["Authentication:AzureAd:ClientSecret"],
            Authority = Configuration["Authentication:AzureAd:AADInstance"] + Configuration["Authentication:AzureAd:TenantId"],
            CallbackPath = Configuration["Authentication:AzureAd:CallbackPath"],
            ResponseType = OpenIdConnectResponseType.CodeIdToken
        });

        app.UseMvc(routes =>
        {
            routes.MapRoute(
                name: "default",
                template: "{controller=Home}/{action=Index}/{id?}");
        });
Run Code Online (Sandbox Code Playgroud)

谢谢

塞缪尔.