C# MS Graph API-点击事件/人物/照片端点时未找到资源
我一直在努力寻找一种解决方案,使用MS Graph API在ASP.NET应用程序中为我的商业邮件帐户创建日历事件 问题 仅供参考,我的企业帐户已被授予我正在使用的订阅的Azure Directory管理员权限,但我无权访问我公司的Active Directory。我的当前Active Directory将我的业务帐户识别为来自“外部Azure Active Directory”源 我已通过使用我的业务帐户访问仅限组织的端点(例如),成功从Azure Active Directory应用程序检索令牌 我有端点的有效令牌 但是,如果我使用相同的令牌向以下用户发送get请求,则会出现“ResourceNotFound”错误 我尝试过的C# MS Graph API-点击事件/人物/照片端点时未找到资源,c#,asp.net,.net,azure,C#,Asp.net,.net,Azure,我一直在努力寻找一种解决方案,使用MS Graph API在ASP.NET应用程序中为我的商业邮件帐户创建日历事件 问题 仅供参考,我的企业帐户已被授予我正在使用的订阅的Azure Directory管理员权限,但我无权访问我公司的Active Directory。我的当前Active Directory将我的业务帐户识别为来自“外部Azure Active Directory”源 我已通过使用我的业务帐户访问仅限组织的端点(例如),成功从Azure Active Directory应用程序检索
new DelegateAuthenticationProvider(
async (requestMessage) =>
{
var idClient = ConfidentialClientApplicationBuilder.Create(appId)
.WithAuthority(authority)
.WithRedirectUri(redirectUri)
.WithClientSecret(appSecret)
.Build();
var tokenStore = new SessionTokenStore(idClient.UserTokenCache,
HttpContext.Current, ClaimsPrincipal.Current);
var accounts = await idClient.GetAccountsAsync();
// By calling this here, the token can be refreshed
// if it's expired right before the Graph call is made
var result = await idClient.AcquireTokenSilent(graphScopes, accounts.FirstOrDefault())
.ExecuteAsync();
requestMessage.Headers.Authorization =
new AuthenticationHeaderValue("Bearer", result.AccessToken);
}));
问题2-
如果我想用我的商业帐户成功地访问MS Graph端点,有人能证实我的假设并提供一些关于下一步该怎么做的提示吗?让业务AAD管理员设置适当的应用程序范围
提前谢谢