IdentityServer4
IdentityServer4在Asp.net core 中的实现
浅浅的博客
这个作者很懒,什么都没留下…
展开
-
IdentityServer4(五)
本文实现控制台应用程序连接IdentityServer服务端进行客户端验证,并调用授权API 1、新建控制台应用程序,nuget包安装 IdentityModel ,Program.cs代码如下: class Program { static async Task Main(string[] args) { var client = new HttpClient(); var disco = await clien原创 2021-09-10 19:41:25 · 215 阅读 · 0 评论 -
IdentityServer4(四)
本文介绍Asp.Net Core MVC项目,连接IdentityServer4项目实现授权登录。 1、新建IdentityServer4项目,选择In-Memory项目模板。 2、将launchSetting.json修改URL,http://localhost:5001 3、修改Startup文件 public class Startup { public IWebHostEnvironment Environment { get; } ..原创 2021-09-10 19:41:12 · 313 阅读 · 0 评论 -
IdentityServer4(三)
1、新建空的asp.net core 项目 目录结构 2、添加 IdentityServer4 相关类库 3、添加Config类 public static class Config { public static IEnumerable<IdentityResource> IdentityResources => new IdentityResource[] { ..原创 2021-09-10 19:40:56 · 107 阅读 · 0 评论 -
IdentityServer4(二)
1、新建空的Identity项目 2、访问localhost:5001/.well-known/openid-configuration 3、访问localhost:5001/connect/token 4、需要用postman 访问localhost:5001/connect/token,要添加参数,不然会报错,错误信息:"error": "invalid_request"或者"error":"invalid_scope" 注意:要在 x-www-form-urlenc...原创 2021-09-10 19:39:14 · 397 阅读 · 0 评论 -
IdentityServer4(一)
新建官方第一个IdentityServer4项目 1、打开cmd命令窗口 输入 dotnet new -i IdentityServer4.Templates 安装IdentityServer4模板 2、VS2019新建项目,搜索IdentityServer 3、选择一个模板 4、注意一下,启动项目名称不是新建的项目名称,可以在这里修改 5、直接运行报错 错误原因,数据库没有初始化造成的。 6、在下面目录运行cmd...原创 2021-09-10 19:38:53 · 236 阅读 · 0 评论