我们有一个用 React 编写的 SPA 和用于托管的 ASP.net 核心。
为了验证应用程序,我们使用 IdentityServer4 并使用 cookie。客户端根据示例配置,这里描述:https : //github.com/IdentityServer/IdentityServer4/tree/main/samples/Quickstarts/4_JavaScriptClient/src
为了验证用户,一切正常。它将被重定向到登录页面。登录后,重定向到 SPA 就完成了。身份验证 cookie 按预期设置:
出于身份验证的原因,cookie 也用于其他 MVC(.net core 和 MVC 5)应用程序。在 SPA 中,我们还使用 SignalR,它需要 cookie 进行身份验证。
我们的问题:
在浏览器中闲置大约 30 分钟并进行刷新或导航后,身份验证 cookie(仅此而已,其他仍然存在)将自动从浏览器中消失。然后用户必须再次登录。为什么这会与 SPA 一起发生?
代码
完整代码可以在github中找到
客户
片段 UserService.ts
const openIdConnectConfig: UserManagerSettings = {
authority: baseUrls.person,
client_id: "js",
redirect_uri: joinUrl(baseUrls.spa, "signincallback"),
response_type: "code",
scope: "openid offline_access profile Person.Api Translation.Api",
post_logout_redirect_uri: …Run Code Online (Sandbox Code Playgroud) 在 Windows 上,我想在 git commit-msg 中运行以下脚本:
MSG="$1"
if ! grep -s -qE "#[0-9]" "$MSG";then
exec < /dev/tty
cat "$MSG"
echo "Your commit message does not contain a reference to a work item. Continue? [y/n]"
read -s -n 1 sure
if [[ $sure == "y" ]]; then
exit 0
else
echo "Aborting commit..."
exit 1
fi
fi
Run Code Online (Sandbox Code Playgroud)
当我使用 Git 扩展时它运行良好。
但是,当我想直接从 Visual Studio(团队资源管理器或 Git 更改)提交时,会出现以下消息的错误:
Your git-hook, '.git/hooks/commit-msg' (line 23) is not supported, likely because it expects interactive console support./r/nSee your …Run Code Online (Sandbox Code Playgroud) 使用任务dotnet build的构建管道开始失败,因为 Build Engine 版本最近从 16.4.0+ 更改为 16.5.0+。
nuget 包SpecFlow依赖于库TechTalk.SpecFlow。
异常看起来像:
C:\Users\VssAdministrator\.nuget\packages\specflow.tools.msbuild.generation\3.1.89\build\SpecFlow.Tools.MsBuild.Generation.targets(93,5): Error MSB4018: The "GenerateFeatureFileCodeBehindTask" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load file or assembly 'TechTalk.SpecFlow, Version=3.1.0.0, Culture=neutral, PublicKeyToken=0778194805d6db41'. The system cannot find the file specified.
Run Code Online (Sandbox Code Playgroud)
我所做的调查(没有帮助):
有任何想法吗?
asp.net ×1
asp.net-core ×1
azure-devops ×1
cookies ×1
git ×1
githooks ×1
reactjs ×1
sh ×1
specflow ×1