在Office 365 API中使用多个范围

酒馆

我想使用两个作用域,https://outlook.office.com/Mail.Readhttps://outlook.office.com/calendars.read阅读经过身份验证的用户的电子邮件和日历。我按照官方的.Net(WPF)教程对用户进行身份验证并获得令牌。只要我的范围只是以上范围之一,它就可以很好地工作。两者同时使用时,我在尝试获取令牌时不会找回令牌。

这基本上就是我要做的:

private static string[] scopes = { "https://outlook.office.com/Mail.Read", "https://outlook.office.com/calendars.read" };

// sign-in/authenticate logic (with PromptBehavior.Always/Never) from tutorial

// here, the result doesn't contain a token:
result = await authContext.AcquireTokenAsync(scopes, null, clientId, redirectUri, new PlatformParameters(PromptBehavior.Always, null)); 

我究竟做错了什么?

杰森·约翰斯顿

尝试将Mail.Read范围更改为所有小写:

private static string[] scopes = { "https://outlook.office.com/mail.read", "https://outlook.office.com/calendars.read" };

它看起来像ADAL库中的错误。在GitHub上提出了一个问题

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章