IdentityService4 认证与授权中心  认证过程: 授权过程:授权码模式,从下往上看

IdentityService4 认证与授权中心
 认证过程:
授权过程:授权码模式,从下往上看

IdentityService4 认证与授权中心
 认证过程:
授权过程:授权码模式,从下往上看

1 :请求资源要加上 access_token 头。一般是 jwt 格式的 bearer

234 :一般都封装了,直接配置 认证服务器的地址(下图auth,比如 http:locahost:8000)+自己的名字(在auth的眼里叫做 APIResource) 即可。ps:也可以自己写过滤器或者中间件来实现。

IdentityService4 认证与授权中心
 认证过程:
授权过程:授权码模式,从下往上看

授权过程:授权码模式,从下往上看

IdentityService4 认证与授权中心
 认证过程:
授权过程:授权码模式,从下往上看

 identityservice4 验证和 jwt token 生成过程

IdentityService4 认证与授权中心
 认证过程:
授权过程:授权码模式,从下往上看

 用户登录并确定授权范围成功后:

  1. auth 发放授权码
  2. client 用授权获请求 auth
  3. auth 验证client
  4. auth 验证 scope
  5. auth 验证 apiresource
  6. auth 组装 Claim 数据 
    1. 从 client 获取 claim
    2. 从 IProfileService 接口实现获取
    3. 根据 claimtypes 筛选
  7. auth  把筛选出的 claim 生成到 jwt 格式 acces_token 中