【发布时间】:2018-04-25 17:59:20
【问题描述】:
我有一个通过 azure 上的 web api 登录到原生 wpf 应用程序的系统。
AuthenticationContext authContext = new AuthenticationContext(string.Format("https://login.windows.net/{0}", authority));
AuthenticationResult tokenAuthResult = authContext.AcquireTokenAsync(resource, clientId, new Uri(redirectUri), new PlatformParameters(PromptBehavior.Auto)).Result;
if (tokenAuthResult == null) return;
Credentials.RestCredentials = new TokenCredentials(tokenAuthResult.AccessToken);
Credentials.UserName = string.Concat(tokenAuthResult.UserInfo.GivenName, " ", tokenAuthResult.UserInfo.FamilyName);
这一切都很完美,返回令牌等。 用户都在 ADAL 中,并且有针对他们的关联组(这些都是 O365 用户)。 我希望能够查询登录用户关联的组是什么。 我需要使用 Graph api 进行新的调用吗? 我是否使用返回的令牌? 我在这里有点迷路了。 提前致谢 斯科特
【问题讨论】:
标签: c# rest azure-active-directory adal