- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我在 Azure AD 中创建了一个 Multi-Tenancy 应用程序当我尝试获取访问 token 并检查 jwt.io 时,我发现 scp (Scope) 丢失了。
//string authority = "https://login.microsoftonline.com/{0}/common/oauth2/v2.0/token?&response_type=code&scope=openid%20profile%20User.ReadWrite%20User.ReadBasic.All%20Sites.ReadWrite.All%20Contacts.ReadWrite%20People.Read%20Notes.ReadWrite.All%20Tasks.ReadWrite%20Mail.ReadWrite%20Files.ReadWrite.All%20Calendars.ReadWrite";
//string authority = "https://login.microsoftonline.com/{0}/common/oauth2/v2.0/token?&scope=https://graph.windows.net/directory.read%20https://graph.windows.net/directory.write";
//string authority = "https://login.microsoftonline.com/{0}/common/oauth2/v2.0/token";
//string authority = "https://login.microsoftonline.com/{0}";
//string authority = "https://login.microsoftonline.com/{0}/common/oauth2/v2.0/token?&response_type=code&scope=openid%20profile%20User.Read%20User.ReadWrite%20User.ReadBasic.All";
//string authority = "https://login.microsoftonline.com/{0}/oauth2/token?scope=User.ReadBasic.All";
//string authority = "https://login.microsoftonline.com/{0}/oauth2/token?scope=User.ReadBasic.All";
string authority = "https://login.microsoftonline.com/common/oauth2/v2.0/token?response_type=token&scope=User.ReadBasic.All";
我已经尝试了很多权威 URL 的组合
string graphResourceId = "https://graph.microsoft.com";
string clientId = "XXXX";
string secret = "XXXX";
authority = String.Format(authority, tenantId);
AuthenticationContext authContext = new AuthenticationContext(authority);
var accessToken = authContext.AcquireTokenAsync(graphResourceId, new ClientCredential(clientId, secret)).Result;
如何获取 microsoft.graph 资源的范围?
最佳答案
如果是委托(delegate)权限,在运行时作为客户端访问 token 中的 “scp” 声明提供给资源。
但是您正在使用应用程序权限,它使用客户端应用程序的凭据/身份指定基于角色的访问,在运行时作为“角色”呈现给资源"在客户端的访问 token 中声明。
"Delegated" permissions, which specify scope-based access using delegated authorization from the signed-in resource owner, are presented to the resource at run-time as "scp" claims in the client's access token.
Application permissions, which specify role-based access using the client application's credentials/identity, are presented to the resource at run-time as "roles" claims in the client's access token.
How to get scope of microsoft.graph resource?
我们可以从这个link中得到答案.
Permission requests are configured on the "Applications" / "Settings" tab in the Azure portal, under "Required Permissions", by selecting the desired "Delegated Permissions" and "Application Permissions" (the latter requires membership in the Global Admin role). Because a public client can't securely maintain credentials, it can only request delegated permissions, while a confidential client has the ability to request both delegated and application permissions. The client's application object stores the declared permissions in its requiredResourceAccess property.
关于c# - 未找到范围内的 Azure AD 访问 token (scp),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52697767/
我想知道使用 SCP 传输文件时使用的默认模式是什么(ASCII 或二进制,如 FTP)。 SCP 中是否有任何文件模式概念?它是如何工作的 ? 最佳答案 FTP中的文件传输方式用于解决不同操作系统行
我想知道是否有一种方法可以让我通过remote1主机直接从本地计算机对remote2主机的文件进行SCP。 网络仅允许从远程 1 主机连接到远程 2 主机。另外,remote1 主机和remote2
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 已关闭 6 年前。 此问题是由拼写错误或无法再重现的问题引起的。虽然类似的问题可能是 on-topic在这里
我正在寻找一个多平台解决方案,可以让我检查 scp命令可用。 问题是 scp 没有 --version命令行,当不带参数调用时,它将返回退出代码 1 (错误)。 更新:如果不清楚,多平台我的意思是一个
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题? Update the question所以它是on-topic对于堆栈溢出。 10年前关闭。 Improve this qu
我在 Windows A 上运行 freeSSHD,需要通过 scp 传输文件。运行 freesshd 的 Windows 可以通过 ssh 客户端连接。但是 Windows 上的 WinSCP 和
我正在我的 Windows 机器上使用腻子通过 ssh 访问 ubuntu 服务器,并尝试将单个文件下载到我的本地 Windows 机器 我的 Windows 用户名是 Mark,每个 cmd 的主机
所以我发现我可以通过标准输入对 scp 执行以下操作: 目录创建 scp -tr . stdin -> D0755 0 stdin -> \x00 文件写入 scp -tr . stdin -> C
请为我在工作中面临的问题提供您的专家选项。 Ant SCP 任务不起作用 - 因为我可以使用 cygwin 进行 scp。 本地环境:windows 7 64 位、Jdk 1.6.0.24、Ant-1
我需要重新安装我们的一台服务器,作为预防措施,我想移动 /home、/etc、/opt和 /Services 到备份服务器。 但是,我有一个问题:由于存在大量符号链接(symbolic link),因
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a software
我有一个小型应用程序,它试图执行十几个并行“scp”运行,从远程系统中提取文件。通常,它运行良好。有时,一两个 scp 悄悄地死掉了。(如果从 Linux 中拉出,则为“安静”。如果从 HP-UX 中
我有一个脚本可以将文件从一台服务器传输到另一台服务器,但它给出了一个错误: Net::SCP::Error (SCP did not finish successfully ()): 有谁能够帮助我?
下面是我的 shell 脚本片段,我在其中执行 scp 命令将文件从 machineB 复制到 machineA。 for element in ${x[$key]}; do # no quote
我有一个适用于不同客户端的脚本,需要将 SCP 文件发送到不同的主机。根据客户端和服务器的组合,我可能需要使用密码身份验证或公钥身份验证。我真的无法提前知道使用哪一个。 我使用的 SCP 有 2 个
我正在尝试使用 libssh2 scp 从实例中检索文件。 为了确保我的用户名、密码和 key 正确无误,我做了: sudo scp -v -P #port -i /home/username/.ss
我正在尝试使用 scp 在两台 Mac (OS 10.6.8) 之间传输文件。但它失败了,因为我的目录/文件名中有空格。我无法更改目录/文件名。 在我的 Mac 的终端中工作时,我经常使用\符号来表示
我需要一些帮助来在 xml 中构建这一行。对于谷歌内容 API 我想要得到的结果是 25 目前我的代码输出这一行 25这是不正确的。 这是我的代码 b = Nokogiri::XML::Builder
我正在使用命令: docker-machine scp 管理器:/home/docker/foo.txt 。 但是,Windows PowerShell 返回“您必须在本地拥有 scp 二进制文件的副
我们知道 String将被存储在SCP(字符串常量池)区域: 1.以同样的方式String[]也存储在SCP中?我的意思是每个数组包含一个 String ,那么这又会被存储在 SCP 中吗? 2.那么
我是一名优秀的程序员,十分优秀!