随笔分类 - .netcore实践1
摘要:1-增加IdentityServer4.AspNetIdentity nuget包 2- StartUp.cs启用增加相应的代码 .AddAspNetIdentity<ApplicationUser>() 3-去掉之前注释过的代码 3-修改Lgoin中的代码,不再使用之前测试的代码 依赖注入的代码
阅读全文
摘要:1-定义一个从前台传到后台的viewModel 2-确定逻辑实现 3-前台consent/index.cshtml 4 _scopeListItem.cshtml
阅读全文
摘要:1-在授权服务端建立相应的显示ViewModel 2-新建相应的授权页ConsentController, 3-编写相应的index.cshtml 4- _ScopeListItem.cshtml分页视图 5-Config.cs 6-显示结果
阅读全文
摘要:1-新建.net core2.1 mvc网站 2-在Startup.config文件增加相关代码, 下面代码已经配置好oidc客户端了,并设置本mvc启动ip为5009 3-新建一个测试页,新加HomeController.cs home.cshtml页代码 显示结果
阅读全文
摘要:1-我们使用之前项目的mvcCookieAuthSampe2进行改造 1.1 增加IdentityServer4 2-增加Config.cs文件,对IdentityServer提供相关的配置数据 2-在Startup.cs文件启用IdentityServer 3-在AccountController
阅读全文
摘要:1-服务端代码, 配置类,可加 RequireClientSecret=false, 这样调用端就不需要传入client_secret参数 2-在Start.up.cs增加 .AddTestUsers(Config.GetTestUsers()) ;用于测试用户 3-客户端代码, 与 ClientC
阅读全文
摘要:1-新建.net core控制台应用程序 2-使用nuget工具安装 IdentityModel 3-编写API调用,说明http://localhost:5000是授权服务器, 5001是网站服务器客户端,即提供资源端 使用dotnet run运行后,结果如下
阅读全文
摘要:1-创建客户端的webapi项目 2-在需要启用授权的方法上增加Authorize标签 3-使用nuget工具安装 IdentityServer4.AccessTokenValidation 4-启用客户端授权, 需要配置连接的授权的服务器等 Startup.cs 5-修改启动的url, 为了在测试
阅读全文
摘要:1-新建webapi IdentityServer4服务器项目 2-增加IdentityServer4 Nuget包, 按下Ctrl+p, 输入>nuget ,增加IdentityServer4包,然后再用dotnet restore保存 3-增加Config.cs类, 用于提供IdentitySe
阅读全文
浙公网安备 33010602011771号