摘要: 首先假设我们依据官方示例有这样一个自定义的授权handler public class FunAuthorizeAttribute : AuthorizeAttribute, IAuthorizationRequirement,IAuthorizationRequirementData { publ 阅读全文
posted @ 2024-04-28 15:20 diudiu1 阅读(7) 评论(0) 推荐(0) 编辑
摘要: 一、安装SSH 较新的windows操作系统一般会系统自带,或者在应用与功能开启下载安装文件 https://github.com/PowerShell/Win32-OpenSSH运行安装 msiexec /i D://openssh-win32.msi 检查 SSH 服务的状态。 在 PowerS 阅读全文
posted @ 2023-08-09 11:44 diudiu1 阅读(1323) 评论(0) 推荐(0) 编辑
摘要: 先贴认证授权官方文档 https://docs.microsoft.com/zh-cn/aspnet/core/security 认证:又叫身份验证,由用户提供凭据,然后将其与存储在操作系统、数据库、应用或资源中的凭据进行比较。 在授权过程中,如果凭据匹配,则用户身份验证成功,可执行已向其授权的操作 阅读全文
posted @ 2022-01-18 16:54 diudiu1 阅读(862) 评论(0) 推荐(1) 编辑
摘要: 最开始用的JWT, 使用以下配置; //AddSwaggerGen c.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme { Description = "JWT Authorization header using the Bear 阅读全文
posted @ 2021-06-04 16:51 diudiu1 阅读(1092) 评论(2) 推荐(0) 编辑
摘要: 错误 C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -NoProfile -WindowStyle Hidden -ExecutionPolicy RemoteSigned -File "C:\Us 阅读全文
posted @ 2020-09-30 10:29 diudiu1 阅读(733) 评论(7) 推荐(0) 编辑
摘要: 链接地址:https://web.dev/samesite-cookies-explained/ https://blog.chromium.org/2019/10/developers-get-ready-for-new.html https://docs.microsoft.com/en-us/ 阅读全文
posted @ 2020-08-13 14:30 diudiu1 阅读(449) 评论(0) 推荐(1) 编辑
摘要: 1. 下载安装 https://www.iis.net/downloads/microsoft/application-request-routing ,这里可能还会要安装 web平台安装程序,麻烦一些; 2.启动代理功能 3. 添加新的网站,端口可以自己设置,我这边设置的8013,目录可以指向空的 阅读全文
posted @ 2020-08-10 18:07 diudiu1 阅读(387) 评论(0) 推荐(0) 编辑
摘要: identityserver4 的版本前段时间更新到V4,和之前的版本,还是有一些使用的差异; 1. API资源声明,之前版本用的是ApiResource,新版本用的是ApiScope,从名字就可以看出区别,新版是用 Scope 区分的; /// <summary> /// 新版本 /// </su 阅读全文
posted @ 2020-07-23 15:12 diudiu1 阅读(1448) 评论(0) 推荐(1) 编辑
摘要: 在微服务项目中使用的Identityserver4,给各个API添加认证时看到下面两种方式,写法一是原始的写法,写法二是Identityserver4封装的写法,主要是在根据token获取用户信息时存在差异。 写法一获取用户ID时的claim的type是 http://schemas.xmlsoap 阅读全文
posted @ 2020-06-11 15:33 diudiu1 阅读(751) 评论(0) 推荐(0) 编辑
摘要: 最近在处理上传视频,需要获取视频信息和截图,这里就需要用到ffmpeg; 由于我的项目是在docker compose中运行调试,所以ffmpeg也需要在docker中能调用; 网上找到的方法在Dockerfile中安装ffmpeg; .net core 运行的docker容器可以理解为一个安装了. 阅读全文
posted @ 2020-06-02 16:51 diudiu1 阅读(1345) 评论(0) 推荐(0) 编辑