Forum Discussion
Aug 24, 2016
PnP Sample Core.CloudService problem
I'm trying to follow the instructions on https://github.com/OfficeDev/PnP/tree/master/Samples/Core.CloudServices in order to set up a web service than can talk to an Office 365 tenant. I'm trying...
Aug 31, 2016
OK, now I have a WebApi Azure web app, and I have registered it in Azure AD. I have a client ID and client secret. I plan to use app-only authentication, not user authentication. I want to follow the process described in https://graph.microsoft.io/en-us/docs/authorization/app_only. I assume I am not the first person to do this. Is there sample code in C# that implements the process described in that article? My webservice is being called with a parameter that is the ID of an email message. I want to use the Graph API for emails to get the subject and attachment from the message whose ID was passed in.
- VesaJuvonenSep 01, 2016
Microsoft
You can for example follow the guidance from PnP Partner Pack (starter kit for partners) at https://github.com/OfficeDev/PnP-Partner-Pack/blob/master/Documentation/Manual-Setup-Guide.md for enabling app-only with Azure. You'll need to do few steps, but the PnP Partner Pack documentation is great step-by-step process on doing required steps.
- Sep 01, 2016
Vesa,
Thank you. I followed the Partner Pack instructions at https://github.com/OfficeDev/PnP-Partner-Pack/blob/master/Documentation/Manual-Setup-Guide.md. There were a few things I ran into:
- The documentation uses screen shots and instructions for the old azure portal. I had to use manage.windowsazure.com to upload the certificate and set the app setting. I couldn't figure out where to do that in portal.azure.com. It would be great if the docs could be updated to reflect using the current Azure Portal.
- When I needed to add the Key Credentials to the manifest json file, I got an error, as described here: https://social.msdn.microsoft.com/Forums/azure/en-US/7c8bc608-7e9e-4075-9a18-1982ad4679c4/unable-to-upload-application-manifest-file?forum=WindowsAzureAD#8fa9e6cb-84c6-454a-9f4f-d825738e0a1f . As you can see, my fix was to upload a version of the manifest where I had the keyCredentials cleared out, then upload one where it was set.
- Also, the instructions in the Partner Pack contain the sentence:"There, you will have to configure a setting called WEBSITE_LOAD_CERTIFICATES with a value of ***. " Given the associated picture, I believe the sentence should end with quote-star-quote ("*") instead of star-star-star (***).
Hope that helps other people.
Now I still have to write the code that gets the token and uses it to talks to the O365 APIs that I am interested in.
VesaJuvonen wrote:You can for example follow the guidance from PnP Partner Pack (starter kit for partners) at https://github.com/OfficeDev/PnP-Partner-Pack/blob/master/Documentation/Manual-Setup-Guide.md for enabling app-only with Azure. You'll need to do few steps, but the PnP Partner Pack documentation is great step-by-step process on doing required steps.
- BertJansenSep 02, 2016
Microsoft
Hi Michael,
If your main interest is understanding how to authenticate using "app-only" with Azure AD then I would recommend checking this web cast: https://channel9.msdn.com/blogs/OfficeDevPnP/PnP-Web-Cast-Introduction-to-Authentication-Manager-in-PnP-Core-Library.
The PnP core library has classes that make it easy to do what you want.