【发布时间】:2020-11-30 07:13:29
【问题描述】:
我使用 django-allauth 使某人可以使用 azure 提供程序链接他的 microsoft 帐户,现在我想访问 Azure DevOps Api。我在 Azure Active Directory 中注册了该应用并启用了 Azure DevOps 权限。当我尝试访问https://dev.azure.com/{organization}/{project}/_apis/git/repositories?api-version=5.1 时,返回状态码 203。
查看文档 (https://docs.microsoft.com/en-us/rest/api/azure/devops/git/repositories/list?view=azure-devops-rest-5.1#oauth2) 我可以看到 Azure DevOps 身份验证所需的令牌 url 是:https://app.vssps.visualstudio.com/oauth2/token 但 django-allauth 从 https://login.microsoftonline.com/common/oauth2/v2.0/token 获取它的 azure 令牌。
我的问题是:我可以以某种方式链接这 2 个令牌吗?像使用我现有的令牌向https://app.vssps.visualstudio.com/oauth2/token 发出请求并为 Azure DevOps 获取新令牌之类的东西?如果是,我会怎么做?欢迎任何帮助
【问题讨论】:
-
到目前为止你尝试了什么?
-
不多,我想我会尝试编写自己的提供程序
标签: python django azure-devops azure-active-directory django-allauth