c# - Azure DevOps OAuth enpoint 始终返回 error=InvalidScope
问题描述
我坚持使用 Oauth 2.0 将我的 C# MVC 应用程序授权给 Azure DevOps Services API。我遵循了本教程:https ://docs.microsoft.com/en-us/azure/devops/integrate/get-started/authentication/oauth?view=azure-devops
当我请求以下授权 URL 时,我将收到错误“InvalidScope”。所以,我一定做错了什么。
https://app.vssps.visualstudio.com:443/oauth2/authorize?client_id= {id}&response_type=Assertion&state=statestring&scope=vso.code_status&redirect_uri=https%3a%2f%2flocalhost%3a44380%2foauth%2fcallback
我的回调 URL 已成功请求,但始终显示错误“InvalidScope”消息。所以,我不明白我做错了什么。
如果有人可以进一步帮助我,将不胜感激!
解决方案
答案是需要在授权 URL 中指定所有可用范围,因此我指定的所有 Azure DevOps 范围似乎都是必需范围。
推荐阅读
- php - Wordpress 从 api 更新数据
- c++ - replace_first_copy,有很多警告和错误
- css - 如何实现支持 HTML 的工具提示?
- mysql - 如何删除mysql中所有重复的行
- r - R - 使用for循环或lapply对文件夹中的两个文件应用函数并将结果保存在一个数据帧中
- python - 使用 Python 查找字符串中的相似点和矛盾点
- multithreading - 对于通过单个语句访问的变量,我是否需要 QMutex?
- angularjs - 选中复选框时如何显示和隐藏段落
- python - 从列表中减去嵌套列表不能按预期工作
- reactjs - 如果我在我的 react-app 中使用 typescript 元组,我会在 vscode 的第 1 行收到一个 eslint 错误?