Guidance Request - Using Microsoft.Identity.Web.GraphServiceClient With Certificate Avoiding Appsettings.json #2367
Unanswered
Sn3akyP3t3
asked this question in
Q&A
Replies: 1 comment
-
The |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm looking for advisement on how to use the
Microsoft.Identity.Web.GraphServiceClient
library, but not using appsettings.json as seen in the sample code exhibited in the tutorials and documentation.I'm trying to follow the advisement to use
Microsoft.Identity.Web.GraphServiceClient
instead of the tried and trueMSAL.NET
for authentication, but the sample code and all other examples seen rely on the existence of appsettings.json which I cannot adopt. In my current application the Client and Tenant ID are set as environment variables and expected to be passed into the application that way. The certificate is loaded from the Windows certificate store and expected to be passed, but also on Linux from file and expected passed as an object as well.I did find another example of what is recommended for a daemon C# application, but it seems to rely on
Azure.Identity
which in turn I believe relies on MSAL.NET and not the advisedMicrosoft.Identity.Web.GraphServiceClient
library.Alternatively, I do like that another option exists (Access Microsoft Graph from a secured app as the app), but I think its too soon for me to adopt this for my existing application since it will require quite a bit of refactoring and coordination with system admins to enable.
Lastly, to Microsoft. I don't understand why you would advise to use certificates over secrets, but then not provide an abundance of examples and sample code exhibiting use of certificates in documentation and sample code.
Beta Was this translation helpful? Give feedback.
All reactions