.net core 中 Identity Server 4 Topic 之 Startup
约定 简称 Id4。
Id4在.net core 中的使用符合.net core 的约定架构,即Services来注册服务,middleware方式集成。
1. 配置服务
通过DI注入:
public void ConfigureServices(IServiceCollection services)
{
var builder = services.AddIdentityServer();
}
也可以使用选项模式,配置更多的参数。
services.AddIdentityServer((ops) =>
{
ops.Endpoints.EnableDiscoveryEndpoint = true
})
1. 2 Key material
- AddSigningCredential
添加签名证书服务提供token的创建/验证。 - AddTemporarySigningCredential
创建临时签名证书服务。用于DEV环境下没有证书可用的时候。 - AddDeveloperSigningCredential
- AddValidationKeys
Adds keys for validating tokens. They will be used by the internal token validator and will show up in the discovery document. This is useful for key roll-over scenarios.
1. 3 In-Memory configuration stores
内存数据库,存储等。
- AddInMemoryClients
注册内存环境的Client。 - AddInMemoryIdentityResources
注册内存环境的IdentityResource 。 - AddInMemoryApiResources
定义内存环境中的Api资源。
1. 4 Test Stores
用于非生产环境下的开发。默认的quickstart UI下。
- AddTestUsers
1. 5 额外的服务
- AddExtensionGrantValidator
- AddSecretParser
- AddSecretValidator
- AddResourceOwnerValidator
- AddProfileService
- AddAuthorizeInteractionResponseGenerator
- AddCustomAuthorizeRequestValidator
- AddCustomTokenRequestValidator
1.6 缓存
- AddClientStoreCache
- AddResourceStoreCache
实现了 ICache接口。
2. 配置管道
public void Configure(IApplicationBuilder app)
{
app.UseIdentityServer();
}
中间件的方式集成Id4.
.net core 中 Identity Server 4 Topic 之 Startup的更多相关文章
- .net core 中 identity server 4 之Topic --定义API资源
想要让客户端能够访问API资源,就需要在Identity Server中定义好API的资源. Scope作用域:即API资源的访问范围限制. 作用域是一个资源 (通常也称为 Web API) 的标识符 ...
- .net core 中 identity server 4 之Server简单示例
Steps: 1.新建一个ASP.NET Core Web项目,SigmalHex.IdentityServer: 2.安装包 Install-Package IdentityServer4 3.St ...
- .net core 中 identity server 4 之术语
id4的职责: 保护你的资源 通过本地 账户库(Account Store)或者外部身份提供其 认证用户 提供Session管理以及SSO 管理和认证客户端 发行身份及访问Token给客户端 验证To ...
- .net core 中 identity server 4 之Topic --定义Client
客户端指能够从id4获取Token的角色. 客户端的共性: a unique client ID a secret if needed the allowed interactions with th ...
- 在ASP.NET Core中使用托管启动(hosting startup)程序集,实现批量注册service
在启动ASPNET Core时可以从外部程序集向应用添加增强功能.例如,外部库可以用托管启动( hosting startup) 实现为应用程序提供附加配置(Configuration)或服务(ser ...
- asp.net core 中 sql server 2017 数据库连接测试
使用sql server 2017 进行连接: 配置appsettings.json文件 { "ConnectionStrings": { "DefaultConnect ...
- 转 深入理解net core中的依赖注入、Singleton、Scoped、Transient
出处:http://www.mamicode.com/info-detail-2200461.html 一.什么是依赖注入(Denpendency Injection) 这也是个老身常谈的问题,到底依 ...
- 深入理解net core中的依赖注入、Singleton、Scoped、Transient(四)
相关文章: 深入理解net core中的依赖注入.Singleton.Scoped.Transient(一) 深入理解net core中的依赖注入.Singleton.Scoped.Transient ...
- 深入理解net core中的依赖注入、Singleton、Scoped、Transient(四)【转】
原文链接:https://www.cnblogs.com/gdsblog/p/8465401.html 相关文章: 深入理解net core中的依赖注入.Singleton.Scoped.Transi ...
随机推荐
- 在html中怎么格式化输出json字符串
#今天的项目用到,看俊哥找到,特此记录下来 步骤: 1.在html页面中输入下面的标签,必须是在pre标签内输出格式才会生效: <pre id="songReqJson"&g ...
- HDU 5225 枚举
题目链接: hdu:http://acm.hdu.edu.cn/showproblem.php?pid=5225 bc(中文):http://bestcoder.hdu.edu.cn/contests ...
- lintcode-511-交换链表当中两个节点
511-交换链表当中两个节点 给你一个链表以及两个权值v1和v2,交换链表中权值为v1和v2的这两个节点.保证链表中节点权值各不相同,如果没有找到对应节点,那么什么也不用做. 注意事项 你需要交换两个 ...
- Spark Shuffle之Sort Shuffle
源文件放在github,随着理解的深入,不断更新,如有谬误之处,欢迎指正.原文链接https://github.com/jacksu/utils4s/blob/master/spark-knowled ...
- [微软官网]One Windows Kernel
One Windows Kernel https://techcommunity.microsoft.com/t5/Windows-Kernel-Internals/One-Windows-Kerne ...
- Ubuntu 16.04 LTS安装sogou输入法详解
http://blog.csdn.net/qq_21792169/article/details/53152700 最近开始学习linux 在安装输入法中遇到的一些问题,最终成功安装,也得益于网络上的 ...
- 虚拟机中安装 centOS,本地安装 SSH 连接 - 01
下面把自己安装 centOS 的过程记录下,选取的版本是 centOS6.8 ,下载地址在脚本之家 down 的 : 阿里云 x64 http://mirrors.aliyun.com/centos/ ...
- 公告:请访问我的个人博客新站点——www.huangshujia.me
我的个人博客现在在(http://www.huangshujia.me/)cnblog这里不会做任何更新了.或者关注我的个人公众号:碱基矿工
- namesapce的作用 增加访问路径 目的:区分不同包的相同action的访问路径
- 【刷题】BZOJ 1453 [Wc]Dface双面棋盘
Description Input Output Sample Input Sample Output HINT Solution 不强制在线的动态图问题,那就LCT了 类似二分图那道题目 对于四个方 ...