1. 修改 Config.cs using System.Collections; using System.Collections.Generic; using IdentityServer4.Models; using IdentityServer4.Test;//测试的时候使用 namespace IdentityServiceSample { public class Config { public static IEnumerable<ApiResource> GetResourc…
1.OAuth密码模式 2.在VS中创建WebAPI项目 在nuget中安装: Microsoft.AspNet.WebApi.Owin Microsoft.Owin.Host.SystemWeb 这两个类库并添加Owin启动类Startup using System; using System.Threading.Tasks; using Microsoft.Owin; using Owin; using Microsoft.Owin.Security.OAuth; [assembly: Ow…
上文已经介绍了Identity Service的实现过程.今天我们继续,实现一个简单的Weather API和一个基于Ocelot的API网关. 回顾 <Angular SPA基于Ocelot API网关与IdentityServer4的身份认证与授权(一)> Weather API Weather API实现非常简单,直接用Visual Studio 2019 Community Edition自带的ASP.NET Core Web Application模板创建就行了,我们的目的不是为了实…