首页 > 其他 > 详细

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

时间:2019-04-28 22:37:16      阅读:132      评论:0      收藏:0      [点我收藏+]

可以在*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地址

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

原文:https://www.cnblogs.com/thinksjay/p/10787257.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!