GitHub的通用OAuth实现|位桶| GitLab | Azure Devops

发布于 2025-02-01 20:40:06 字数 380 浏览 1 评论 0原文

我正在建立一个Web应用程序,用户必须在Github中提供对其存储库的访问权限|位桶| GitLab |任何其他代码托管平台。

我已经通过OAuth2实现了它,我必须在所有平台上创建客户端应用程序。
最初,它仅范围范围为github |刻有水桶,但现在我希望我的Web应用程序也支持所有其他主要平台。

因此,我当前的实现要求我为所有其他平台创建客户端应用程序,这很忙,因为我们也希望支持本地版本控制系统。

是否有一种安全且通用的方法可以授权到版本控制系统?

一种解决方案是用户直接向我的Web应用程序提供其个人访问令牌(加密),以便我的应用程序可以保存这些pat并将其用于将以后提取存储库。
但是我想知道这是一种安全还是标准方法。如果不是这样,那么解决此问题的适当解决方案。

I am building a web application where users have to provide my web application access to their repositories in GitHub| Bit bucket| Git Lab | any other code hosting platform.

I have implemented it through OAuth2 for which I had to create client applications on all platforms separately.
Initially it was scoped only to GitHub | Bit Bucket but now I want my web application to support all other major platforms as well.

So my current implementation requires me to create client applications for all other plat platforms which is a hectic because We want to give support for On-Premise version control system as well.

Is there a secure and generic way to authorize to version control system ?

One solution is that user directly provide their Personal Access Tokens (Encrypted) to my web application so that my application can save these PAT and use them to pull the repositories in future.
But I wonder if this is a secure enough or a standard method. If not then what might be the appropriate solution to this problem.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我做我的改变 2025-02-08 20:40:07

您可能需要使用一个OAuth2提供商,例如:

  • dexidp/dex/dex ,一种使用OpenID Connect的身份服务来驱动其他应用程序的身份验证。
    DEX通过“ Connectors “,它可以支持您的目标< /p>

  • < p>或 casdoor ,身份和访问管理(IAM)/单身 - 带有Web UI支持OAuth 2.0的Sign-On(SSO)平台,包括您的一些目标。

oauth2并不是唯一的选择,因为 SmartGit 说明

经过一定的反思,我意识到我实际上没有遇到SmartGit和Azure Devops的身份验证问题,因此我花了一些时间尝试弄清楚SmartGit在Azure Devops中的存储库有多么认证。

我最终确定它通过GIT凭据管理器使用个人访问令牌。
因此,SmartGit对Pats的明确支持毕竟可能并不是关键功能。安装git(至少在Windows上)时,您也可以选择安装Git凭据管理器。
只要这样做,您就应该有光滑的航行。

You might need to use an Oauth2 provider like:

  • dexidp/dex, an identity service that uses OpenID Connect to drive authentication for other apps.
    Dex acts as a portal to other identity providers through "connectors", which do support your targets

  • or casdoor, an Identity and Access Management (IAM) / Single-Sign-On (SSO) platform with web UI supporting OAuth 2.0, including some of your targets.

Oauth2 is not the only option, as illustrated by SmartGit

After some reflection I realized that I actually haven’t had authentication problems with SmartGit and Azure DevOps for quite a while, so I spent some time experimenting to figure out just how SmartGit is authenticating to my repos in Azure DevOps.

I ultimately determined that it uses Personal Access Tokens via the Git Credential Manager.
So explicit support of PATs by SmartGit probably isn’t a critical feature after all. When you install Git (on Windows at least), you have the option to install the Git Credential Manager as well.
As long as you do that you should have smooth sailing.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文