我很难找到适合这种情况的工作示例:
IConfidentialClientApplication confidentialClientApplication = ConfidentialClientApplicationBuilder
.Create(clientId)
.WithRedirectUri(redirectUri)
.WithClientSecret(clientSecret)
.Build();
OnBehalfOfProvider authProvider = new OnBehalfOfProvider(confidentialClientApplication, scopes);
我面临的问题:1.我从哪个包中获得 OnBehalfOfProfider?2.假设我必须获得一个 AAD 用户的访问令牌,而无需用户的实际登录(它是一个守护程序应用程序) - 我如何构建 UserAssertion 实例?
这里的信息基于两个来源:MSDN 'on behlaf of provider' https://docs.microsoft.com/en-us/graph/sdks/choose-authentication-providers?tabs=CS#OnBehalfOfProvider 和 github's 'how to调用 OBO' https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/wiki/on-behalf-of
谢谢艺术