Building a SharePoint Provider-Hosted App for Office365 - Part Two - Creating the Provide-Hosted App
In first part we created the Cert, Token Issuer and App Principal, in this the second post on creating a SharePoint provider-host app we will step through the process I followed and also the steps I took, this app will have no branding and in the third post we will brand the App… let's begin…
- Choose what version you would like to point your app to, for this work through I am using SharePoint Online
- Choose the type of web application you would like to create, for this example I am using ASP.NET Web Forms Application
- Locate the following line of code: <RemoteWebApplication ClientId="66142967‐91BB‐4C50‐9B70‐06375D5240BC" />
- and Replace it with the clientID you got from the AppPrincipalCreator PowerShell Script you ran in the 1st Post of this series or read the blog again here
- Locate the following line of code:
- and Replace it with the clientID that we put into the AppManifest file above
- Add the following HTML and ASP.NET controls inside the <body>
- This sample uses the UpdatePanel control to enable partial page rendering.
- In the Default.aspx.cs file of your web application, add the variables below inside the Page class.
listOfUsers = new List ();
listOfLists = new List ();
- Add the
RetrieveWithCSOMmethod inside the Page class. This method uses the SharePoint CSOM to retrieve information about your site and display it on the page.
- Add the
CSOM_Clickmethod inside the Page class. This method triggers the event that occurs when the user clicks the Populate Data link.
- Replace the existing Page_Load method. The Page_Load method uses methods in the TokenHelper.cs file to retrieve the context from the Request object and get an access token from Microsoft Azure Access Control Service (ACS).
- From this
- To this
Step Twenty One
Step Twenty Two
Step Twenty Three
Step Twenty Four
- So now we have created a Provider-Hosted App and retreved information from our SharePoint site, in the next post we will brand this the app with the Chrome control