- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 Fluent Azure SDK for .NET 尝试获取租户中所有服务主体的列表。
var authenticatedContext = Azure.Authenticate(
await SdkContext.AzureCredentialsFactory.FromServicePrincipal(aadClientId, aadClientSecret, tenantId, "AzureGlobalCloud")
);
var sps = authenticatedContext.ServicePrincipals.ListAsync().GetAwaiter().GetResults();
具有 AAD 客户端 ID 的服务主体具有 Directory.Read.All API 权限。(只是为了确保我没有遗漏任何内容:我在 Azure 门户的 ServicePrincipal -> 权限部分中看到了此权限)
但是仍然抛出以下错误:Microsoft.Azure.Management.Graph.RBAC.Fluent.Models.GraphErrorException:操作返回无效的状态代码“禁止”
但是,获取 ADGroup 和订阅列表的标注可以工作
var subs = authenticatedContext.Subscriptions.ListAsync().GetAwaiter().GetResults();
var sgs = authenticatedContext.Subscriptions.ActiveDirectoryGroups().GetByIdAsync(someId).GetAwaiter().GetResults();
我不知道缺少什么权限。
最佳答案
我在我这边测试了代码,并使用fiddler来捕获请求。 sdk 似乎请求 Azure AD graph api 而不是 Microsoft graph api 来列出服务主体。因此,您需要添加AAD graph的权限Directory.Read.All
,而不是Microsoft graph。请引用以下步骤:
添加权限后,不要忘记授予管理员同意。然后您可以成功运行代码来获取服务主体。
顺便说一句,AAD权限Directory.Read.All
存在一个错误。如果我们在注册的应用中添加AAD权限Directory.Read.All
,那么即使我们从页面中删除该权限也无法删除。因此,即使您从页面的“API 权限”选项卡中删除了 Directory.Read.All
,您仍然可以成功运行代码。
关于 azure : Permission for Service Principal to get list of Service Principals,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63799115/
我正在使用 Fluent Azure SDK for .NET 尝试获取租户中所有服务主体的列表。 var authenticatedContext = Azure.Authenticate(
我需要查找哪个主体修改或创建了给定主体。 我们可以使用 Microsoft Graph Api 获得修改后的主体列表: https://graph.microsoft.com/beta/service
我目前在 Azure 中有 10 个 SQL 数据库。在 Azure 门户中,我有我的用户名 (omnipos)。 当我想使用 MSSM 连接到数据库时,出现错误 无法作为数据库主体执行,因为主体“[
我正在尝试追踪 glassfish 中的一条烦人的消息正在污染我们的日志文件的原因。 为了简化我们的设置,我们有 2 个运行 3.1.2.2 的 glassfish 服务器。 服务器 A 上部署了一个
我在应用程序中使用springSecurityCore插件,并且用户在appStartupController中登录后,我喜欢 def index = { if (springSecurityS
你好,你好吗?我是 Azure 中组织订阅的唯一所有者,我需要创建服务主体。 我如何向我的用户授予权限?或者我可以创建一个新角色来分配此权限吗? 有什么想法吗? 提前致谢 最佳答案 注意:订阅的角色和
我很困惑为什么在 WebAPI 中需要设置 Principal,因为每次调用都是完全无状态的。因为每次调用都应该是完全无状态的,所以使用您记录的用户信息设置它有什么好处和原因? 我的印象是,一个登录的
我一直在看这篇文章: http://pythonhosted.org/Flask-Principal/#granular-resource-protection 现在虽然它当前的工作方式没有任何问题,
我是编写 flask 的新手,目前使用 flask-principal 作为我的授权机制。当用户试图在没有所需权限的情况下访问 url 时,flask-principal 会引发 Permission
Spring Security 假设 Authentication 是 Principal 。 public interface Authentication extends Principal, S
在装饰器中调用安全身份验证属性 principal.displayName 是否会导致问题? 我将其设置为 sitemesh 装饰器中的变量:
我正在Grails中编写更新或更改用户数据表单。这是我表单的一部分,用户可以在其中更改其旧登录名: Логин ... 更新之前必须显示旧的用户数据。我用它:${springSe
在我的 ASP 项目中,我使用的是 ASP.NET Identity 2.2.1。在许多地方,我必须获得当前(登录)用户的电子邮件。现在我发现那个用户使用这个: var user = await Us
为什么 Principal.IsMemberOf(GroupPrincipal) ( MSDN ) 在以下测试中为 Domain Computers 组返回假阴性? [TestMethod] publ
我正在尝试确定给定的本地用户帐户是否在本地管理员组中。在系统加入域之前一切正常。当加入域时抛出异常,提示未找到网络路径,但仅在查找本地非管理员帐户时才会抛出异常;如果测试帐户是本地管理员,则该方法返回
我有一个在 Tomcat 中运行的网络应用程序。我想允许任何拥有服务器信任的有效证书的用户访问 Web 应用程序,但我想从证书中读取用户的 DN。我用 clientAuth="true"配置了 SSL
有没有一种标准的方法可以将 CSS 文件命名为主体文件?我有两个 CSS 文件(一个用于 Bootstrap,一个用于我的自定义 CSS),我希望自定义文件中的所有样式对所有元素文件都同样重要。但我也
所有,我正在编写一个依赖于 flask-principal 的 flask 应用程序用于管理用户角色。我想编写一些简单的单元测试来检查哪些用户可以访问哪些 View 。已发布代码示例 on paste
在谈论 .NET 中的身份时,我们想到了 Principal .有接口(interface) IPrincipal并与它一起实现 ClaimsPrincipal .我们甚至可以随时使用 Thread.
本文整理了Java中org.apache.wss4j.common.principal.WSUsernameTokenPrincipalImpl类的一些代码示例,展示了WSUsernameTokenP
我是一名优秀的程序员,十分优秀!