小编RAh*_*pte的帖子

带有 Asp .NET Core 的多租户 Web 应用程序登录问题

设置多租户应用程序后,出现以下错误。处理请求时发生未处理的异常。

SecurityTokenInvalidIssuerException: IDX10205: 发行人验证失败。发行人:“ https://sts.windows.net/2566cb39-d9fg-5ad6-tryb-d1e2kl067a89/ ”。不匹配:validationParameters.ValidIssuer:'null'或validationParameters.ValidIssuers:' https : //sts.windows.net/{tenantid}/'。

Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler+d__12.MoveNext() 堆栈查询 Cookie 标头 SecurityTokenInvalidIssuerException:IDX10205:颁发者验证失败。发行人:“ https://sts.windows.net/2096cb39-d9fd-4ad6-bbeb-d1e2be067a89/ ”。不匹配:validationParameters.ValidIssuer: 'null' 或 validationParameters.ValidIssuers: ' https://sts.windows.net/{租户}/'。Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler+d__12.MoveNext() System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务) System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务) Microsoft.AspNetCore.Authentication.AuthenticationMiddleware+d__6.Move () System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) Microsoft.AspNetCore.Session.SessionMiddleware+d__9.MoveNext() Microsoft.AspNetCore.Session.SessionMiddleware+d__9 .MoveNext() System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) System.Runtime.CompilerServices.TaskAwaiter。

下面是startup.cs代码

    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using System.Threading.Tasks;
    using LPPlusUI.Models;
    using Microsoft.AspNetCore.Authentication;
    using Microsoft.AspNetCore.Authentication.Cookies;
    using Microsoft.AspNetCore.Authentication.JwtBearer;
    using Microsoft.AspNetCore.Authentication.OpenIdConnect;
    using Microsoft.AspNetCore.Builder;
    using Microsoft.AspNetCore.Hosting;
    using Microsoft.EntityFrameworkCore;
    using Microsoft.Extensions.Configuration;
    using Microsoft.Extensions.DependencyInjection;
    using Microsoft.Extensions.FileProviders;
    using Microsoft.IdentityModel.Tokens;
    using ReflectionIT.Mvc.Paging;
    namespace LPPlusUI
    {
        public class Startup
        { …
Run Code Online (Sandbox Code Playgroud)

azure multi-tenant azure-active-directory azure-web-app-service asp.net-core

1
推荐指数
1
解决办法
2720
查看次数