简体   繁体   English

github 身份验证令牌存储在 Windows 的什么位置?

[英]Where is github authentication token stored on Windows?

If I run a command similar to the following on a private repository:如果我在私有存储库上运行类似于以下的命令:

git ls-remote https://github.com/org/repo.git

I'm getting this following prompt.我收到以下提示。

在此处输入图像描述

I'm using https://gitforwindows.org and looking at the Process Explorer, it appears that the executable that produces this window is \mingw64\libexec\git-core\git-credential-manager.exe relative to Git for Windows installation folder. I'm using https://gitforwindows.org and looking at the Process Explorer, it appears that the executable that produces this window is \mingw64\libexec\git-core\git-credential-manager.exe relative to Git for Windows installation文件夹。

When I put in my credentials, I'm getting an email from Github, saying that a new authentication token is created.当我输入凭据时,我从 Github 获得了 email,表示创建了一个新的身份验证令牌。

Where is this token stored on my PC?此令牌存储在我的 PC 上的什么位置? When I repeat the command above I'm no longer getting the prompt - as long as I do not revoke the token on the github web site.当我重复上面的命令时,我不再收到提示 - 只要我不撤销 github web 站点上的令牌。

By default, Git will use the Windows Credential Manager for storing and retrieving Git credentials via Github for Windows desktop. By default, Git will use the Windows Credential Manager for storing and retrieving Git credentials via Github for Windows desktop.

Credential Manager lets you view and delete your saved credentials for signing in to websites, connected applications, and networks.凭据管理器允许您查看和删除已保存的用于登录网站、连接的应用程序和网络的凭据。

To open Credential Manager, type credential manager in the search box on the taskbar and select Credential Manager Control panel.要打开凭据管理器,请在任务栏和 select凭据管理器控制面板的搜索框中键入凭据管理器。 Select Web Credentials or Windows Credentials to access the credentials you want to manage. Select Web 凭据Windows 凭据以访问您要管理的凭据。

You will find the GitHub - https://api.github.com/{username} entry on the Windows Credentials tab.您将在GitHub - https://api.github.com/{username}上的ZAEA23489CE3AACD436406

Mike Mackintosh is right.迈克·麦金托什是对的。 Here is how you can access the token.以下是访问令牌的方法。

Install-Module CredentialManager -Scope AllUsers -Force

Change flags on the above command to your liking.根据您的喜好更改上述命令的标志。 Then:然后:

Get-StoredCredential -AsCredentialObject | %{$_} `
  | ?{ $_.targetName -like "*github.com*"} `
  | sort LastWritten `
  | select LastWritten,Targetname,Password

This will get you the list of tokens you may have created.这将为您提供您可能已创建的令牌列表。 Use Get-Command -Module CredentialManager to list all avialble commands on the module, you can use to manipulate the credentials store.使用Get-Command -Module CredentialManager列出模块上所有可用的命令,您可以使用它来操作凭证存储。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM