组成
IdentityServer,Api和Client(客户端,asp .net core)
本文以官方demo:https://github.com/IdentityServer/IdentityServer4.Samples/tree/release/Quickstarts/6_AspNetIdentity 作为模板进行讲解
流程
![](http://upload-images.jianshu.io/upload_images/9128511-836f527e9de6ac93.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/700)
2
预设:IdentityServer配置各Api相关信息,Api配置IdentityServer相关信息
1.用户访问客户端,客户端发现用户没有登录(授权)
2.根据客户端设置的令牌发行者基本地址,访问IdentityServer的网站
3.在IdentityServer的网站进行登录,成功后获得令牌,返回客户端
4.访问Api接口(有两种方式:User Access Token和Client Credentials)
5.Api验证令牌通过,返回结果