加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net-mvc – 在ASP.NET MVC组织帐户中访问Azure AD Graph API

发布时间:2020-12-16 09:55:28 所属栏目:asp.Net 来源:网络整理
导读:我试图根据登录用户的AD组限制页面访问.我有以下代码的问题. var tenantId = incomingPrincipal.FindFirst(GraphConfiguration.TenantIdClaimType).Value; //create Azure Graph Api client to make api calls var client = Helpers.AzureGraphAPIFunctions.
我试图根据登录用户的AD组限制页面访问.我有以下代码的问题.

var tenantId = incomingPrincipal.FindFirst(GraphConfiguration.TenantIdClaimType).Value;

 //create Azure Graph Api client to make api calls
 var client = Helpers.AzureGraphAPIFunctions.GetActiveDirectoryClient(tenantId);

 IGroup group = client.Groups.Where(x => x.DisplayName == groupName).ExecuteSingleAsync().Result;

这些代码工作正常,并通过groupName获取AD组,但有时会抛出异常

“Tenant information is not available locally. Use the following Urls
to get the information.”

{"odata.error":{"code":"Directory_BindingRedirection","message":{"lang":"en","value":"Tenant information is not available locally. Use the following Urls to get the information."},"values":[
          {"item":"Url1","value":"https://directory-s1-ch1.directory.windows.net"},{"item":"Url2","value":"https://directory-s1-sn2.directory.windows.net"},{"item":"Url3","value":"https://directory-s1-co1.directory.windows.net"},{"item":"Url4","value":"https://directory-s1-bl2.directory.windows.net"}
         ]}}

有任何想法吗?

谢谢

解决方法

伙计们,

我们目前正在调查此问题(您不应该看到此错误).它看起来像一个回归.当我有更多信息时会更新这个帖子.

更新:
现在应该解决此问题.我们对网关逻辑进行了更新,打破了一些重试/重定向逻辑.我们现在已经放置了一些监视器,它们应该更快地检测到这个问题(如果我们再次犯同样的错误).

为那些受此事件影响的人道歉.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读