使用当前的Active Directory凭据对Azure DevOps进行身份验证 [英] Authenticate to Azure DevOps using current Active Directory credentials

查看:130
本文介绍了使用当前的Active Directory凭据对Azure DevOps进行身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在尝试构建一些需要访问Azure DevOps的内部开发人员工具。我们在Azure DevOps中的组织以及我们的计算机都链接到同一个Azure Active Directory,因此我认为应该可以通过以下方式传递该身份验证
;如果我输入了用户名和密码以登录到Windows,然后我就可以通过Windows身份验证访问网络资源,那么Azure DevOps也应该这样,因为它是相同的Active Directory。但是,没有我尝试过b $ b的方法似乎生成了有效的凭据,而且我找不到任何涵盖这种情况的文档。我试过了:


new VssCredentials()


new VssCredentials(true)


new VssCredentials(新的WindowsCredential())


新的VssCredentials(新的WindowsCredential(true))


新的VssCredentials(新的WindowsCredential(System.Net.CredentialCache.DefaultCredentials) )


新的VssCredentials(新的WindowsCredential(System.Net.CredentialCache.DefaultNetworkCredentials))


我也尝试将VssCredentials.PromptType设置为PromptIfNeeded ,但它没有效果。我总是得到同样的错误:Microsoft.VisualStudio.Services.Common.VssUnauthorizedException:VS30063:您无权访问https://< organization> .visualstudio.com。
有没有办法进行身份验证,不需要使用oAuth或强制每个用户手动创建访问令牌只是为了登录他们已登录的帐户?

解决方案

嗨大卫,


感谢您的光临!


这是一个帖子讨论使用WindowsCredentials验证DevOps:


https:/ /stackoverflow.com/questions/44526798/connect-to-tfsteamprojectcollection-using-windowscredentials


此外,这里有一些关于AAD和Azure DevOps的文档,以帮助确保您拥有所有正确的权限:


https://docs.microsoft.com/en-us/azure/devops/organizations/a ccounts / connect-organization-to-azure-ad?view = azure-devops#connect-your-organization-to-your-azure-ad


https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/access-with-azure-ad? view = azure-devops


希望它有所帮助!


We're trying to build some internal developer tools that need to access Azure DevOps. Our organization in Azure DevOps, as well as our computers, are all linked to the same Azure Active Directory, so I assume it should be possible to flow that authentication through; if I've entered my user name and password in order to log on to Windows, and I'm then able to access network resources via Windows authentication, the same should work for Azure DevOps because it's the same Active Directory. However, no approach I've tried seems to generate credentials that work, and I can't find any documentation covering this scenario. I've tried:

new VssCredentials()

new VssCredentials(true)

new VssCredentials(new WindowsCredential())

new VssCredentials(new WindowsCredential(true))

new VssCredentials(new WindowsCredential(System.Net.CredentialCache.DefaultCredentials))

new VssCredentials(new WindowsCredential(System.Net.CredentialCache.DefaultNetworkCredentials))

I've also tried setting the VssCredentials.PromptType to PromptIfNeeded, but it has no effect. I always get the same error: Microsoft.VisualStudio.Services.Common.VssUnauthorizedException : VS30063: You are not authorized to access https://<organization>.visualstudio.com. Is there any way to authenticate that doesn't require using oAuth or forcing every user to manually create an access token just to log into the account they're already logged in to?

解决方案

Hi David,

Thank you for reaching out!

Here is a thread that talks about authenticating DevOps using WindowsCredentials:

https://stackoverflow.com/questions/44526798/connect-to-tfsteamprojectcollection-using-windowscredentials

Also, here is some documentation on AAD and Azure DevOps to help ensure you have all the correct permissions:

https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/connect-organization-to-azure-ad?view=azure-devops#connect-your-organization-to-your-azure-ad

https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/access-with-azure-ad?view=azure-devops

Hope it helps!


这篇关于使用当前的Active Directory凭据对Azure DevOps进行身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆