内容简介:项目背景:基于人脉关系的金融行业项目用户:1、账号:
任务4:第一章计划与目录
-
敏捷产品开发流程
-
原型预览与业务介绍
-
整体架构设计
-
API 接口设计 / swagger
-
Identity Server 4 搭建登录
-
账号 API 实现
-
配置中心
任务5:业务介绍
项目背景:基于人脉关系的金融行业项目
用户:
1、账号:
-
基本资料维护
-
登录
2、管理自己的项目
-
创建
-
分享(可见权限范围)
-
置顶
-
查看项目进展
3、引入别人的项目
-
查看好友的项目
-
查看二度人脉的项目
-
查看系统推荐的项目
-
查看别人的项目
-
参与别人的项目
4、消息:
-
聊天消息
-
系统消息
5、好友:
-
添加好友(导入通信录,手机号搜索好友)
任务6:架构设计
任务7:oAuth2介绍
OAuth是一个关于授权(authorization)的开放网络标准
四种授权方式:
-
授权码模式
-
简化模式
-
密码模式
-
客户端模式
理解OAuth 2.0:
https://www.ruanyifeng.com/blog/2014/05/oauth_2_0.html
任务8:IdentityServer4登录中心
新建项目
dotnet new webapi --name IdentityServerCenter
添加 Nuget 包:IdentityServer4
VS Code 如何安装 nuget:
https://blog.csdn.net/qq_36051316/article/details/84106418
安装失败原因及解决方案:
vscode解决nuget插件不能使用的问题:
https://www.cnblogs.com/lori/p/11651079.html
Visual Studio 连接不上NuGet 官方程序包源的解决办法:
https://blog.csdn.net/weixin_34161083/article/details/85764761
配置 Startup 配置
添加引用
using IdentityServer4;
注册服务
services.AddIdentityServer()
.AddDeveloperSigningCredential();
使用服务
app.UseIdentityServer();
在 Program.cs 中配置启动端口
webBuilder.UseUrls("http://localhost:5000");
添加配置类 Config.cs,初始化 IdentityServer4
using System.Collections;
using System.Collections.Generic;
using IdentityServer4.Models;
namespace IdentityServerCenter
{
public class Config
{
public static IEnumerable<ApiResource> GetResource()
{
return new List<ApiResource>
{
new ApiResource("api", "My Api")
};
}
public static IEnumerable<Client> GetClients()
{
return new List<Client>
{
new Client()
{
ClientId = "client",
AllowedGrantTypes = GrantTypes.ClientCredentials,
ClientSecrets =
{
new Secret("secret".Sha256())
},
AllowedScopes = {"api"},
}
};
}
}
}
更改 IdentityServer4 配置
services.AddIdentityServer()
.AddDeveloperSigningCredential()
.AddInMemoryApiResources(Config.GetResource())
.AddInMemoryClients(Config.GetClients());
启动程序
dotnet run
访问地址
http://localhost:5000/.well-known/openid-configuration
结果如下( json 格式化)
{
"issuer": "http://localhost:5000",
"jwks_uri": "http://localhost:5000/.well-known/openid-configuration/jwks",
"authorization_endpoint": "http://localhost:5000/connect/authorize",
"token_endpoint": "http://localhost:5000/connect/token",
"userinfo_endpoint": "http://localhost:5000/connect/userinfo",
"end_session_endpoint": "http://localhost:5000/connect/endsession",
"check_session_iframe": "http://localhost:5000/connect/checksession",
"revocation_endpoint": "http://localhost:5000/connect/revocation",
"introspection_endpoint": "http://localhost:5000/connect/introspect",
"device_authorization_endpoint": "http://localhost:5000/connect/deviceauthorization",
"frontchannel_logout_supported": true,
"frontchannel_logout_session_supported": true,
"backchannel_logout_supported": true,
"backchannel_logout_session_supported": true,
"scopes_supported": [
"api",
"offline_access"
],
"claims_supported": [],
"grant_types_supported": [
"authorization_code",
"client_credentials",
"refresh_token",
"implicit",
"urn:ietf:params:oauth:grant-type:device_code"
],
"response_types_supported": [
"code",
"token",
"id_token",
"id_token token",
"code id_token",
"code token",
"code id_token token"
],
"response_modes_supported": [
"form_post",
"query",
"fragment"
],
"token_endpoint_auth_methods_supported": [
"client_secret_basic",
"client_secret_post"
],
"id_token_signing_alg_values_supported": [
"RS256"
],
"subject_types_supported": [
"public"
],
"code_challenge_methods_supported": [
"plain",
"S256"
],
"request_parameter_supported": true
}
可以看到四种授权方式:
"grant_types_supported": [
"authorization_code",
"client_credentials",
"refresh_token",
"implicit",
"urn:ietf:params:oauth:grant-type:device_code"
],
课程链接
http://video.jessetalk.cn/course/explore
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网
猜你喜欢:- 『互联网架构』软件架构-分布式架构(14)
- 『互联网架构』软件架构-分布式系列并发编程(29)
- 『互联网架构』软件架构-解密电商系统-分布式session(77)
- 『互联网架构』软件架构-分布式之大型网站的演变过程(28)
- 分布式存储架构设计
- 分布式架构知识体系
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
计数组合学(第一卷)
斯坦利 / 付梅、侯庆虎、辛国策 / 高等教育 / 2009-6 / 42.00元
《计数组合学(第1卷)》是两卷本计数组合学基础导论中的第一卷,适用于研究生和数学研究人员。《计数组合学(第1卷)》主要介绍生成函数的理论及其应用,生成函数是计数组合学中的基本工具。《计数组合学(第1卷)》共分为四章,分别介绍了计数(适合高年级的本科生),筛法(包括容斥原理),偏序集以及有理生成函数。《计数组合学(第1卷)》提供了大量的习题,并几乎都给出了解答,它们不仅是对《计数组合学(第1卷)》正......一起来看看 《计数组合学(第一卷)》 这本书的介绍吧!