IdentityServer3 PublicOrigin和IssuerUri在IdentityServerOptions中的区别和使用

标签 identityserver3 identityserver4

部署到 IIS 时遇到了一些问题。显然客户端使用反向代理和所有显示 IP 地址而不是域名的 OpenId 配置迪斯科。 PublicOrigin解决了我的问题。但是,我仍然不明白两者之间的区别,

PublicOrigin


IssuerUri

示例:
var options = new IdentityServerOptions
{
    PublicOrigin = "https://myids/project1/",
    IssuerUri = "https://myids/project1/",
    ...
}

如果两个值分别更新,我也可以从迪斯科显示变化,即;
{
  "issuer": "https://myids/project1/",
  "jwks_uri": "https://myids/project1/.well-known/jwks",
  "authorization_endpoint": "https://myids/project1/connect/authorize",
  "token_endpoint": "https://myids/project1/connect/token",
  "userinfo_endpoint": "https://myids/project1/connect/userinfo",
  "end_session_endpoint": "https://myids/project1/connect/endsession",
  "check_session_iframe": "https://myids/project1/connect/checksession",
  "revocation_endpoint": "https://myids/project1/connect/revocation",
  "introspection_endpoint": "https://myids/project1/connect/introspect",
  ...
}

为什么不把它和 IssuerUri 一样。我已经阅读了这方面的文档。技术上只是对属性的描述。我想了解更多。

非常感谢。

最佳答案

IssuerUri是授权服务器的唯一标识符 .此属性的值嵌入到 iss 中的 ID 标记中。属性,它是在 token 验证期间。

在另一边, PublicOrigin只是服务器的公共(public) URI .如果服务器位于反向代理之后,那么如果没有此提示,它将在 OpenID Connect 元数据 (.well-known/openid-configuration) 中通告私有(private) URI。

为什么不只拥有单一属性(property)? OpenID Connect 规范 (§ 16.15. Issuer Identifier) 支持驻留在同一主机和端口上的多个颁发者。但是,规范中的同一部分建议每个主机和端口仅托管一个发行者(即单租户)。

什么时候使用 Multi-Tenancy 架构? 假设您想构建和销售自己的身份验证即服务。现在您有两个选择 - 为您的每个客户分配专用 URI ( PublicOrigin ) 或使用单个 PublicOrigin与专用 IssuerUri对于每个客户。

关于IdentityServer3 PublicOrigin和IssuerUri在IdentityServerOptions中的区别和使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45747625/

相关文章:

c# - 有什么方法可以通过 identityserver3 将自定义状态或上下文从客户端传递到自定义 IdP?

asp.net-mvc - 在Asp.net Core中openid connect登录后运行代码

asp.net-mvc - IdentityServer4基于角色的授权

c# - ASP.NET Core 声明是否旨在指定用户可以执行的操作

asp.net - ASP Core、Identity Server 4 和 Angular 2 中的外部提供商登录

identityserver4 - SaveTokens = OpenIdConnect 中间件中的真傻?

c# - 身份服务器 : Login after account activation

c# - 检查访问 token 是否有效 - 身份服务器

oauth-2.0 - 如何在 IdentityServer 中启用滑动过期

asp.net-mvc-4 - 从 identityserver4 登录的 asp.net mvc 出现 invalid_request 错误