威势网络,为您的企业和团队注入互联网活力!
服务热线:138-9741-0341
相关专题
C#
VC++
.NetCore
Kotlin
Xamarin
推荐阅读

IdentityServer4表结构浅析

模块<------------------------->对应表 允许的授权类型: ClientGrantTypes 允许的作用域: ClientScope ===>[ IdentityResources,ApiResources? ApiScopes ] 不断整理中... ...

730 次
2022/10/6

The instance of entity type 'XXX' cannot be tracked because another insta....

The instance of entity type 'XXX' cannot be tracked because another insta....

EF同时打开两个实例, public IActionResult Client(Client client) { var client_temp = _ConfigurationDbContext.Clients.Include(i => i.AllowedGrantTypes).Where(c => c.Id==client.Id).FirstOrDefault(); ..... } 看以上代码,前台模型绑定时提交了一个Client实例,我们又用代码自己从数据库中创建了一个实例 client_temp ,这样,EF就同时跟踪维护着两个一模一样的实例,当我们对Client进行编辑后,再保存,EF就抛出异常: ...

936 次
2022/10/6

ASP.NET Core 6 and Authentication Servers

ASP.NET Core 6 and Authentication Servers

In .NET 3.0 we began shipping IdentityServer4 as part of our template to support the issuing of JWT tokens for SPA and Blazor applications. Sometime after we shipped, the IdentityServer team made an announcement changing the license for future versions of IdentityServer to a reciprocal public license – a license where the code is still open source but if used for commercial purposes then a paid license must be bought. This type of approach is comm ...

674 次
2022/10/2

c#反射工程

c#反射工程

反向工程从数据库生成模型MODEL PM> dotnet user-secrets init PM> dotnet user-secrets set ConnectionStrings:Is4 "Server=127.0.0.1;Port=5432;Database=MYDB;User Id=username;Password=1234567;Pooling=true;Include Error Detail=true;" PM>dotnet ef dbcontext scaffold Name=ConnectionStrings:Is4 Npgsql.EntityFrameworkCore.PostgreSQL 官网支持:https://learn.microsoft.com/zh-cn/ef/core/managing-schemas/scaffolding/?tabs=dotnet-core-cli ...

728 次
2022/9/22

从壹开始 [ Ids4实战 ] 之三║ 详解授权持久化 & 用户数据迁移

从壹开始 [ Ids4实战 ] 之三║ 详解授权持久化 & 用户数据迁移

哈喽大家周三好,今天终于又重新开启 IdentityServer4 的落地教程了,不多说,既然开始了,就要努力做好????。 书接上文,在很久之前的上篇文章《二║ 基础知识集合 &amp; 项目搭建一》中,我们简单的说了说 IdentityServer4 是如何调用和配置 Token 的,主要是一些入门的基础知识和概念,也算是第一次尝鲜了,其实 Ids4 本身没有那么神秘,我们只需要知道它是一个丰富的认证框架,又具有很好的可扩展性,核心就是如何配置某些客户端通过该授权服务来包括另一些资源服务器,供用户 ...

935 次
2022/9/21

Adding Identity Roles To Identity Server 4 in .NET Core 3.1

Adding Identity Roles To Identity Server 4 in .NET Core 3.1

If you’ve worked on Identity Server 4 surely you’ll notice there is a lack of tutorial on how to-do somethings. For example how to implement roles, and using azure active directory (AAD), splitting data to server and etc. For this tutorial we will tackle on how to implement roles on IdentityServer4 running on ASP.NET Identity setup. Come on, let’s jump in! Prerequisites First of all, you must have a .NET Core 3.1 SDK (Software ...

808 次
2022/9/13

报错SqliteException (0x80004005):找不到数据库或是数据库为只读错误

报错SqliteException (0x80004005):找不到数据库或是数据库为只读错误

明明给数据库文件给了读取写入的权限,但是系统还会依然报错, Microsoft.Data.Sqlite.SqliteException: 'SQLite Error 14: 'unable to open database file 一会说找不到数据库了,一会说打不开数据库了,为了排除问题,直接先给数据库everyone用户所有权限试试,依然报错,如下: An exception occurred in the database while saving changes for context type 'XXX.Data.DBContext'. Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 8: 'attempt to write a readonl ...

1690 次
2022/9/9

[原创] IdentityServer4权限控制---简化客户端对API的访问 (五)

[原创] IdentityServer4权限控制---简化客户端对API的访问 (五)

官网的标题可不这么叫,我斗胆按照自己浅薄的理解起了个这样的名字,官网的标题叫这个: ASP.NET Core and API access 我们花了这么多时间搭建了服务器,其实客户端只干了两件事,首先申请TOKEN,接下来才用这个TOKEN访问API。是不是每次都要这么麻烦,在访问API之前都要先申请一遍TOKEN才行?答案是NO! OpenID Connect 和 OAuth 2.0 组合的美妙之处在于,您可以使用单一协议和令牌服务的单一交换来实现。我们打开IDS4SERVER,在注册服务端的时候做一些简单的配置 修改(IDS4S ...

751 次
2022/9/5