标签: identityserver5

收到“‘IdentityServer:Key’配置部分未配置任何签名凭据。” 使用 IdentityServer 的 ASP.NET Core Web API 中出现错误

我正在开发一个使用 ASP.NET Core 3.1 Web API 构建的后端项目。一切都工作正常,直到我决定将我的项目迁移到 .NET 6,我已根据新的目标框架更新了所有库。

现在,当运行我的 Web API 时,检查运行状况 Url 工作正常,但是当尝试打开 swagger 或调用我的 Web API 的端点时,我收到此错误:

“IdentityServer:Key”配置部分未配置任何签名凭据。

当我使用 .NET Core 3.1 时,我没有遇到这个问题,我做了一些谷歌搜索,我发现添加这个函数.AddDeveloperSigningCredential()可以解决这个问题,但这对我来说不起作用。

这是我的代码:

public static class ProgramExtensions
{
    readonly static string MyAllowSpecificOrigins = "_myAllowSpecificOrigins";

    private const string SecretKey = "**********************";
    private static readonly SymmetricSecurityKey _signingKey = new SymmetricSecurityKey(Encoding.ASCII.GetBytes(SecretKey));

    public static IConfiguration? Configuration { get; set; }

    public static WebApplicationBuilder ConfigureBuilder(this WebApplicationBuilder builder)
    {
        Configuration = new ConfigurationBuilder()
            .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
                  .AddJsonFile($"appsettings.{builder.Environment.EnvironmentName}.json",
                                 optional: …
Run Code Online (Sandbox Code Playgroud)

asp.net-core-identity identityserver5 .net-6.0

6
推荐指数
0
解决办法
2905
查看次数

Identity Server 4 和 Identity Server 5 之间的区别

我目前正在尝试研究 IS4 和 IS5 之间的差异,但发现很难对两者进行可靠的比较。有没有人有任何充分的理由说明为什么有人应该从 4 升级到 5,升级有什么缺点吗?

干杯

asp.net-core identityserver4 identityserver5

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