Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

We are building a WPF application which communicates with a WCF service (hosted in a Windows Service) for data access, business logic, etc. The application runs on a domain user account, the WCF service on a server account. This WCF service should send emails, create and modify events, etc by using the domain user account. Communicating with Office 365 will be done by Microsoft Graph API, using MSAL and Microsoft Graph Library.

The domains active directory and Azure Active Directory are connected.

How can I connect the Graphs GraphServiceClient using the WCF's ServiceSecurityContext without login dialog? (Map a domain user on a AAD user). Are there any samples available?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
217 views
Welcome To Ask or Share your Answers For Others

1 Answer

What you are looking for is a sample for a 'daemon' service. There is documentation here on this. https://azure.microsoft.com/en-us/resources/samples/active-directory-dotnet-daemon-certificate-credential/

Essentially you'll need to create a certificate and register it with the Azure AD application. Then when calling the Microsoft Graph, use that certificate so that thee service trusts its really your service.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...