首页 > 解决方案 > 如何更改 IdentityServer OIDC 发现端点基本 URL?

问题描述

IdentityServer4 提供了一个 OIDC 发现端点,可用于检索有关授权服务器的元数据,包括令牌端点。发现端点可通过 /.well-known/openid-configuration相对于您的 Token Server 的基地址获得。例如,如果我们在本地运行应用程序并对以下端点执行 GET 请求:

https://localhost:44354/.well-known/openid-configuration

然后,我们将看到以下 JSON 模式:

{
    "issuer": "https://localhost:44354",
    "jwks_uri": "https://localhost:44354/.well-known/openid-configuration/jwks",
    "authorization_endpoint": "https://localhost:44354/connect/authorize",
    "token_endpoint": "https://localhost:44354/connect/token",
    "userinfo_endpoint": "https://localhost:44354/connect/userinfo",
    "end_session_endpoint": "https://localhost:44354/connect/endsession",
    
    // code omitted for brevity
}

基于“发现端点可通过 /.well-known/openid-configuration相对于您的令牌服务器的基地址获得”子句,我想知道如何更改此端点的基地址。是否可以在 ASP.NET Core 应用程序中使用?

标签: c#asp.net-core.net-coreidentityserver4openid-connect

解决方案


似乎无法改变这一点。

如果您查看这里的源代码,您会发现它是一个常量:

但是,这个 GitHub 问题及其链接的问题可能会给您一些替代方案:

如何自定义路由路径?


推荐阅读