当前位置: 移动技术网 > IT编程>开发语言>.net > 第42章 发现(discovery) - Identity Server 4 中文文档(v1.0.0)

第42章 发现(discovery) - Identity Server 4 中文文档(v1.0.0)

2019年04月29日  | 移动技术网IT编程  | 我要评论

黄瑜娴,泰勒加尔文将订婚,北极

可以在*https://baseaddress/.well-known/openid-configuration*找到发现文档。它包含有关identityserver的端点,密钥材料和功能的信息

默认情况下,所有信息都包含在发现文档中,但通过使用配置选项,您可以隐藏各个部分,例如:

services.addidentityserver(options =>
{
    options.discovery.showidentityscopes = false;
    options.discovery.showapiscopes = false;
    options.discovery.showclaims = false;
    options.discovery.showextensiongranttypes = false;
});

42.1扩展发现

您可以向发现文档添加自定义条目,例如:

services.addidentityserver(options =>
{
    options.discovery.customentries.add("my_setting", "foo");
    options.discovery.customentries.add("my_complex_setting",
        new
        {
            foo = "foo",
            bar = "bar"
        });
});

当您添加以~开头的自定义值时,它将扩展到identityserver基址以下的绝对路径,例如:

options.discovery.customentries.add("my_custom_endpoint", "~/custom");

如果要完全控制发现(和jwks)文档的呈现,可以实现`idiscoveryresponsegenerator 接口(或从我们的默认实现派生)。

github地址

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网