最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

c# - How can I specify WithAppOnly() globally for a GraphServiceClient, so I don't have to specify it for every single M

programmeradmin1浏览0评论

How can I specify WithAppOnly() globally for a GraphServiceClient, so I don't have to specify it for every single Microsoft Graph request?

Consider the following code:

var c = app.Services.GetRequiredService<GraphServiceClient>();
await c.Users.GetAsync(r => r.Options.WithAppOnly());

The WithAppOnly() instructs the GraphServiceClient to use app-only permissions for Microsoft Graph instead of user permissions.

I wish to specify this globally for the GraphServiceClient, so I don't have to specify it for each request. Is this possible?

#calling-a-web-api-from-a-daemon-application

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论