使用 Intranet 应用程序存储和获取通用凭据

store and get generic credentials with an intranet application

我开发了一个Intranet 应用程序,需要实现"git push" 从本地存储库(在Web 服务器的磁盘上)到远程存储库。 我从 Web 服务器启动 git 进程,它在 IIS 池标识下运行,该标识是 Web 服务器计算机管理员组的域帐户成员。 Git 需要用户凭据才能执行推送操作。我集成了自定义版本的 git-credential-winstore。该程序使用 Windows 凭据管理器 来存储网站的 通用凭据。但是当调用凭证的写入时,我得到错误:

Failed to write credential: A specified logon session does not exist. It may already have been terminated

我检查了政策 "Network access: Do not allow storage of passwords and credentials for network authentication",它被禁用了。

这里出了什么问题?

联营帐户需要访问其用户配置文件。 所以我们需要连接一次 Windows 会话来创建用户配置文件(我认为这是必要的)。接下来在专用应用程序池的高级设置中,设置 "Load User Profile" = true.

关于凭据的注意事项:必须更改 Windows 凭据目标以管理同一 Windows 保管库中的不同用户。我改"git:https://remote-host" by "git_USERID:https://remote-host".

我将此 属性 设置为 enabled,现在可以使用了,也许它也适用于您: