SlideShare a Scribd company logo
DEVELOPING A
PROVIDER HOSTED
SHAREPOINT APP
Talbott Crowell
Boston Area SharePoint User Group
March 13nd, 2013
About Me
• http://about.me/talbott
• Solutions Architect at ThirdM
• A Founder of SharePoint Saturday Boston
• Microsoft MVP
• Blogger and Author
• @talbott
About this Talk
• For Developers
  • Who want to build Apps For SharePoint
• For Architects
  • Who want to understand options and architecture considerations of
    a Provider Hosted App
• For Anyone
  • Who wants to learn more about SharePoint 2013 and the future of
    Extending and Customizing SharePoint
What is a Provider Hosted App
• SharePoint 2013 Compatible Application
• Hosted outside of SharePoint
  • Azure
  • Amazon Web Services (AWS)
  • Rackspace
  • Your Datacenter
  • An on-premise server in your customer’s Datacenter (you provide
    the Application, Hardware, and/or VM)
• Written in any language on any platform
  • Java, F#, Ruby, Linux, Unix
App Development History
            • SharePoint 2003 – Web Parts
            • SharePoint 2007 – Farm Solutions & SPD
               • WSP (A CAB file with deployment assets and
                 instructions) which may include:
                 • Server Code (.NET Assemblies for GAC or BIN)
                 • Client Code (JavaScript Files, CSS, HTML)
                 • ASP.NET (ASPX, ASCX, Master
                   Pages), Images, Site templates, List
                   definitions, Content Types (CAML), Layouts, various
                   other types of content
              • SPD (SharePoint Designer)
                 • Create custom solutions with
                   Workflows, JavaScript, HTML, jQuery, Master
                   Pages, Layouts stored in Content Database
            • SharePoint 2010
               • Sandbox Solutions
            • SharePoint 2013
               • Apps for SharePoint
Apps for SharePoint Hosting Options
• Provider Hosted Apps
   • SharePoint 2013 on-premise
     or Office 365
   • Unlimited scaling
• Autohosted Apps
   • Typically Azure Web Sites
     written in .NET
   • Runs only in Office 365 (no
     on-premise option)
   • Uses the consumers Office
     365 Azure resources
• SharePoint Hosted Apps
   • Client side only
     (JavaScript, jQuery, HTML, CS
     S)
   • Uses CSOM to manipulate
     SharePoint object
• http://bit.ly/spapphosting
Provider Hosted Apps

       Office 365 Data Center         Application Runtime and Backend
or On-Premise SharePoint 2013 Farm   (Can be anywhere: On-Premise or Cloud)


                                         Provider
  SharePoint                                               Provider
    2013
                                         Hosted
                                                           Service
                                           app


                                               Provider Data


               Customer                          Provider
Alternative Using Autohosted

    Office 365 Data Center            Application Runtime and Backend
       (including Azure)                  (Cloud Service you Host)


 Office 365          Autohosted app
                                                        Provider
(SharePoint          Windows Azure
  Online)                                               Service
                     Azure Database



                  Customer Data               Provider Data


              Customer                         Provider
Provider Hosted Architecture
• Store or App Catalog – Deployment Manifest .APP file
• App Manifest – Declare App Permission Requests
• Trust Settings – User must “allow” or “trust” your app
• Provider receives Request with Trust Token
• Provider uses CSOM to call back to SharePoint using the
  Trust Token
• SharePoint persists changes made by the Provider in the
  Content Database (just like SharePoint Designer)
Costs of Being a Provider
• Need to maintain and cover hosting cost
  • But you can extend your app to other ecosystems outside of
    SharePoint
    • iPad, Facebook, Kindle, Salesforce

• Changes will affect ALL customers
  • May need a versioning strategy for customers in Life Sciences
    (long validation lifecycle)
Benefits of Provider Hosted
• Does not tax the SharePoint Farm’s resources as much
    as Farm Solution might
•   Update 1000’s of SharePoint Farms with one release
    update to the Provider
•   Centrally managed at the Provider’s location
•   Develop on any platform using any language leveraging
    your existing developer and infrastructure knowledge
•   Same App works on Office 365 and SharePoint 2013 on-
    premise
Development Model
• Get Started using Azure and Office 365 Preview
  • Many Blog posts on getting started
• Deploy your Provider Hosted app to your Provider
  (Azure, AWS, Rackspace, local server)
• Deploy your .APP file to SharePoint
Development System Requirements
• Visual Studio 2012
  • On Premise Development Environment
  • http://bit.ly/spappdevenv
• Office Developer Tools for Visual Studio 2012
  • http://bit.ly/spapptools
Decisions
• Office 365 or On-Premise?
  • If Office 365, Visual Studio 2012
  • If On-Premise then build your SharePoint 2013 Dev
    Server
   • Windows Server 2012 or Windows Server 2008 R2 SP1
   • http://msdn.microsoft.com/en-us/library/fp161179.aspx
   • http://msdn.microsoft.com/en-us/library/fp179923.aspx


• Andrew Connell’s Critical Path Training
  • SharePoint 2013 Setup Guide for Developers
   • http://bit.ly/cp2013setup
App Packaging
• Start with Visual Studio 2012 Project Template
• .APP
   • Contains AppManifest.xml
    • Set Permission Requests for your App
    • Start Page
    • Client ID
  • App Icon Image File
• You can unpack the .APP by renaming .ZIP
Demo
• Using Visual Studio to create the App Manifest
• Explore Contents
Security
• Client Secret vs Certificate
  • Client Secret requires SharePoint is farm connected to ACS
    • Azure ACS (Access Control Service)
    • Office 365 is already connected to ACS

• AppManifest.xml (.APP)
  • Contains permissions
• OAuth
  • TokenHelper.cs (runs on the Provider)
    • Helps you manage requests for app tokens
    • If you are developing in another language you will need to implement
      this yourself
OAuth Example
TokenHelper.TrustAllCertificates();
string contextTokenString =
    TokenHelper.GetContextTokenFromRequest(Request);
if (contextTokenString != null) {
  contextToken =
    TokenHelper.ReadAndValidateContextToken(
       contextTokenString, Request.Url.Authority);
  sharepointUrl =
    new Uri(Request.QueryString["SPHostUrl"]);
  accessToken = TokenHelper.GetAccessToken(
    contextToken,
    sharepointUrl.Authority).AccessToken;
  CSOM.CommandArgument = accessToken;
}
CSOM
• Client Side Object Model
• Rich improvements over 2012
• .NET version
• JavaScript version
• http://bit.ly/csom2013
CSOM Example
protected void CSOM_Click(object sender,
                              EventArgs e) {
  string commandAccessToken =
        ((LinkButton)sender).CommandArgument;
  RetrieveWithCSOM(commandAccessToken);
  WebTitleLabel.Text = siteName;
  CurrentUserLabel.Text = currentUser;
  UserList.DataSource = listOfUsers;
  UserList.DataBind();
  ListList.DataSource = listOfLists;
  ListList.DataBind();
}

http://bit.ly/spappbasic
CSOM Example
    ClientContext clientContext =
            TokenHelper.GetClientContextWithAccessToken(
                sharepointUrl.ToString(), accessToken);


    //Load the properties for the web object.
    Web web = clientContext.Web;
    clientContext.Load(web);
    clientContext.ExecuteQuery();

    //Get the site name.
    siteName = web.Title;

    //Get the current user.
    clientContext.Load(web.CurrentUser);
    clientContext.ExecuteQuery();
    currentUser = clientContext.Web.CurrentUser.LoginName;

    //Load the lists from the Web object.
    ListCollection lists = web.Lists;
    clientContext.Load<ListCollection>(lists);
    clientContext.ExecuteQuery();
Scope of Access
• What can you get to from CSOM?
Putting it all together
• Generate Client ID and Client Secret
    • Generated by form on SharePoint Online
    • https://<your site>/_layouts/15/appregnew.aspx

• APP Manifest and Icon packaged in .APP file
  • Includes Permission Requests
  • Includes Client ID
  • Deployed to SharePoint
• Your app is deployed to Azure, etc…
   • ClientID and ClientSecret
• Your app receives Token from SharePoint user request
• Your app uses Token to call CSOM
Review
• SharePoint has completely new Development Model
• Leverage existing understanding with CSOM
• Leverage existing other technology knowledge
• Update many customers (or Farms) at once
• Costs and Benefits of being a Provider
• Security with OAuth
• Package and Deploy to Store
Resources
• My Blog for Slides, Questions, and Follow up information
  • http://bit.ly/tcrowell
• Pluralsight Videos by Andrew Connell
  • Over 12 hours of Video
  • http://bit.ly/acplural
• Microsoft MSDN Documentation
  • http://bit.ly/spappmsdn
• CloudShare for developer and test hosting
  • http://www.cloudshare.com/
More Resources
• Steve Fox’s Blog
  • Create a free Azure Web Site to develop Provider Hosted App
  • http://bit.ly/sfoxpart1
  • http://bit.ly/sfoxpart2
• Chris Johnson's loosely typed thoughts…
  • Build a SharePoint Provider Hosted App in 5 mins
  • http://bit.ly/spapp5min
Thank You
  Developing a Provider
  Hosted SharePoint App
   Presented by Talbott Crowell
            @talbott

           Questions?

More Related Content

PPTX
Designing for SharePoint Provider Hosted Apps
PPTX
SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013
PPTX
Developer’s Independence Day: Introducing the SharePoint App Model
PPTX
SharePoint 2013 “App Model” Developing and Deploying Provider Hosted Apps
PDF
SharePoint Fest Chicago 2015 - Anatomy of configuring provider hosted add-in...
PPTX
Apps 101 - Moving to the SharePoint 2013 App Model - Presented 7/27/13 at Sha...
PPTX
Building Apps for SharePoint 2013 by Andrew Connell - SPTechCon
PPTX
App Model For SharePoint 2013
Designing for SharePoint Provider Hosted Apps
SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013
Developer’s Independence Day: Introducing the SharePoint App Model
SharePoint 2013 “App Model” Developing and Deploying Provider Hosted Apps
SharePoint Fest Chicago 2015 - Anatomy of configuring provider hosted add-in...
Apps 101 - Moving to the SharePoint 2013 App Model - Presented 7/27/13 at Sha...
Building Apps for SharePoint 2013 by Andrew Connell - SPTechCon
App Model For SharePoint 2013

What's hot (20)

PPTX
Developing SharePoint 2013 apps with Visual Studio 2012 - Microsoft TechDays ...
PPTX
Deep dive into SharePoint 2013 hosted apps - Chris OBrien
PPTX
Get started with building native mobile apps interacting with SharePoint
PPTX
SharePoint 2013 APIs demystified
PDF
Building SharePoint 2013 Apps - Architecture, Authentication & Connectivity API
PDF
Hard learned CSOM and REST tips
PPTX
Developing SharePoint 2013 apps with Visual Studio 2012 - SharePoint Connecti...
PPTX
Oauth and SharePoint 2013 Provider Hosted apps
PDF
O365Con18 - Hybrid SharePoint Deep Dive - Thomas Vochten
PPTX
Developing hybrid SharePoint apps that run on-premise and in the cloud - ESPC...
PPTX
CSOM (Client Side Object Model). Explained @ SharePoint Saturday Houston
PPTX
Developing hybrid SharePoint apps that run on-premise and in the cloud - Bram...
PDF
Hooking SharePoint APIs with Android
PPTX
Develop iOS and Android apps with SharePoint/Office 365
PDF
O365Con18 - Reach for the Cloud Build Solutions with the Power of Microsoft G...
PPTX
ECS19 - John White - Unlock SharePoint’s Reporting Secrets
PPTX
Understanding SharePoint Apps, authentication and authorization infrastructur...
PPTX
SharePoint Client Object Model (CSOM)
PDF
O365Con18 - PowerApps build custom forms for SharePoint with Azure Maps - Bra...
PPTX
OAuth in SharePoint 2013
Developing SharePoint 2013 apps with Visual Studio 2012 - Microsoft TechDays ...
Deep dive into SharePoint 2013 hosted apps - Chris OBrien
Get started with building native mobile apps interacting with SharePoint
SharePoint 2013 APIs demystified
Building SharePoint 2013 Apps - Architecture, Authentication & Connectivity API
Hard learned CSOM and REST tips
Developing SharePoint 2013 apps with Visual Studio 2012 - SharePoint Connecti...
Oauth and SharePoint 2013 Provider Hosted apps
O365Con18 - Hybrid SharePoint Deep Dive - Thomas Vochten
Developing hybrid SharePoint apps that run on-premise and in the cloud - ESPC...
CSOM (Client Side Object Model). Explained @ SharePoint Saturday Houston
Developing hybrid SharePoint apps that run on-premise and in the cloud - Bram...
Hooking SharePoint APIs with Android
Develop iOS and Android apps with SharePoint/Office 365
O365Con18 - Reach for the Cloud Build Solutions with the Power of Microsoft G...
ECS19 - John White - Unlock SharePoint’s Reporting Secrets
Understanding SharePoint Apps, authentication and authorization infrastructur...
SharePoint Client Object Model (CSOM)
O365Con18 - PowerApps build custom forms for SharePoint with Azure Maps - Bra...
OAuth in SharePoint 2013
Ad

Similar to Developing a Provider Hosted SharePoint app (20)

PPTX
Developing a provider hosted share point app
PPTX
Custom Development in SharePoint – What are my options now?
PPTX
SPCA2013 - Developing SharePoint 2013 Apps with Visual Studio 2012
PPTX
Developing Apps for SharePoint 2013
PPTX
SPS Gulf : SharePoint 2013 Cloud Business App
PPTX
Cloud-Based App Development using SharePoint 2013, Office 365 and Azure
PPTX
D2 - Automate Custom Solutions Deployment on Office 365 and Azure - Paolo Pia...
PPTX
SharePoint Server 2013: to app or not to app?
PPTX
MSDN - SharePoint 2013 to app or not to app
PPTX
Developing Apps for SharePoint Store
PPTX
SP Apps, New Model, New App Store: The Office Store
PPTX
SharePoint 2013 App or Not to App
PDF
Tutorial, Part 1: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
PPTX
The SharePoint 2013 App Model
PPTX
Relearning SharePoint Development
PPTX
Sharepoint 2013 App
PPTX
What's new for Developers in SharePoint 2013
PPTX
Custom Development for SharePoint
PDF
Come riprogettare le attuali farm solution di share point con il nuovo modell...
PPTX
Heading to the Cloud : Introduction to deploying a Provider-Hosted App in Azure
Developing a provider hosted share point app
Custom Development in SharePoint – What are my options now?
SPCA2013 - Developing SharePoint 2013 Apps with Visual Studio 2012
Developing Apps for SharePoint 2013
SPS Gulf : SharePoint 2013 Cloud Business App
Cloud-Based App Development using SharePoint 2013, Office 365 and Azure
D2 - Automate Custom Solutions Deployment on Office 365 and Azure - Paolo Pia...
SharePoint Server 2013: to app or not to app?
MSDN - SharePoint 2013 to app or not to app
Developing Apps for SharePoint Store
SP Apps, New Model, New App Store: The Office Store
SharePoint 2013 App or Not to App
Tutorial, Part 1: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
The SharePoint 2013 App Model
Relearning SharePoint Development
Sharepoint 2013 App
What's new for Developers in SharePoint 2013
Custom Development for SharePoint
Come riprogettare le attuali farm solution di share point con il nuovo modell...
Heading to the Cloud : Introduction to deploying a Provider-Hosted App in Azure
Ad

More from Talbott Crowell (16)

PPTX
Talbott's brief History of Computers for CollabDays Hamburg 2025
PPTX
Top 7 mistakes
PPTX
Top 3 Mistakes when Building
PPTX
Building high performance and scalable share point applications
PPTX
Road to the Cloud - Extending your reach with SharePoint and Office 365
PPTX
Introduction to F# 3.0
PPTX
PowerShell and SharePoint @spsnyc July 2012
PPTX
PowerShell and SharePoint
PPTX
Welcome to windows 8
PPTX
Exploring SharePoint with F#
PPTX
Automating PowerShell with SharePoint
PPTX
F# And Silverlight
PPTX
SharePoint Saturday Boston 2010
PPT
Automating SQL Server Database Creation for SharePoint
PPTX
Introduction to F#
PPTX
Architecting Solutions for the Manycore Future
Talbott's brief History of Computers for CollabDays Hamburg 2025
Top 7 mistakes
Top 3 Mistakes when Building
Building high performance and scalable share point applications
Road to the Cloud - Extending your reach with SharePoint and Office 365
Introduction to F# 3.0
PowerShell and SharePoint @spsnyc July 2012
PowerShell and SharePoint
Welcome to windows 8
Exploring SharePoint with F#
Automating PowerShell with SharePoint
F# And Silverlight
SharePoint Saturday Boston 2010
Automating SQL Server Database Creation for SharePoint
Introduction to F#
Architecting Solutions for the Manycore Future

Recently uploaded (20)

PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Cloud computing and distributed systems.
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Encapsulation theory and applications.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Empathic Computing: Creating Shared Understanding
PDF
Machine learning based COVID-19 study performance prediction
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Chapter 3 Spatial Domain Image Processing.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
The Rise and Fall of 3GPP – Time for a Sabbatical?
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Reach Out and Touch Someone: Haptics and Empathic Computing
“AI and Expert System Decision Support & Business Intelligence Systems”
Advanced methodologies resolving dimensionality complications for autism neur...
Cloud computing and distributed systems.
NewMind AI Monthly Chronicles - July 2025
Per capita expenditure prediction using model stacking based on satellite ima...
Encapsulation theory and applications.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
20250228 LYD VKU AI Blended-Learning.pptx
Network Security Unit 5.pdf for BCA BBA.
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Empathic Computing: Creating Shared Understanding
Machine learning based COVID-19 study performance prediction

Developing a Provider Hosted SharePoint app

  • 1. DEVELOPING A PROVIDER HOSTED SHAREPOINT APP Talbott Crowell Boston Area SharePoint User Group March 13nd, 2013
  • 2. About Me • http://about.me/talbott • Solutions Architect at ThirdM • A Founder of SharePoint Saturday Boston • Microsoft MVP • Blogger and Author • @talbott
  • 3. About this Talk • For Developers • Who want to build Apps For SharePoint • For Architects • Who want to understand options and architecture considerations of a Provider Hosted App • For Anyone • Who wants to learn more about SharePoint 2013 and the future of Extending and Customizing SharePoint
  • 4. What is a Provider Hosted App • SharePoint 2013 Compatible Application • Hosted outside of SharePoint • Azure • Amazon Web Services (AWS) • Rackspace • Your Datacenter • An on-premise server in your customer’s Datacenter (you provide the Application, Hardware, and/or VM) • Written in any language on any platform • Java, F#, Ruby, Linux, Unix
  • 5. App Development History • SharePoint 2003 – Web Parts • SharePoint 2007 – Farm Solutions & SPD • WSP (A CAB file with deployment assets and instructions) which may include: • Server Code (.NET Assemblies for GAC or BIN) • Client Code (JavaScript Files, CSS, HTML) • ASP.NET (ASPX, ASCX, Master Pages), Images, Site templates, List definitions, Content Types (CAML), Layouts, various other types of content • SPD (SharePoint Designer) • Create custom solutions with Workflows, JavaScript, HTML, jQuery, Master Pages, Layouts stored in Content Database • SharePoint 2010 • Sandbox Solutions • SharePoint 2013 • Apps for SharePoint
  • 6. Apps for SharePoint Hosting Options • Provider Hosted Apps • SharePoint 2013 on-premise or Office 365 • Unlimited scaling • Autohosted Apps • Typically Azure Web Sites written in .NET • Runs only in Office 365 (no on-premise option) • Uses the consumers Office 365 Azure resources • SharePoint Hosted Apps • Client side only (JavaScript, jQuery, HTML, CS S) • Uses CSOM to manipulate SharePoint object • http://bit.ly/spapphosting
  • 7. Provider Hosted Apps Office 365 Data Center Application Runtime and Backend or On-Premise SharePoint 2013 Farm (Can be anywhere: On-Premise or Cloud) Provider SharePoint Provider 2013 Hosted Service app Provider Data Customer Provider
  • 8. Alternative Using Autohosted Office 365 Data Center Application Runtime and Backend (including Azure) (Cloud Service you Host) Office 365 Autohosted app Provider (SharePoint Windows Azure Online) Service Azure Database Customer Data Provider Data Customer Provider
  • 9. Provider Hosted Architecture • Store or App Catalog – Deployment Manifest .APP file • App Manifest – Declare App Permission Requests • Trust Settings – User must “allow” or “trust” your app • Provider receives Request with Trust Token • Provider uses CSOM to call back to SharePoint using the Trust Token • SharePoint persists changes made by the Provider in the Content Database (just like SharePoint Designer)
  • 10. Costs of Being a Provider • Need to maintain and cover hosting cost • But you can extend your app to other ecosystems outside of SharePoint • iPad, Facebook, Kindle, Salesforce • Changes will affect ALL customers • May need a versioning strategy for customers in Life Sciences (long validation lifecycle)
  • 11. Benefits of Provider Hosted • Does not tax the SharePoint Farm’s resources as much as Farm Solution might • Update 1000’s of SharePoint Farms with one release update to the Provider • Centrally managed at the Provider’s location • Develop on any platform using any language leveraging your existing developer and infrastructure knowledge • Same App works on Office 365 and SharePoint 2013 on- premise
  • 12. Development Model • Get Started using Azure and Office 365 Preview • Many Blog posts on getting started • Deploy your Provider Hosted app to your Provider (Azure, AWS, Rackspace, local server) • Deploy your .APP file to SharePoint
  • 13. Development System Requirements • Visual Studio 2012 • On Premise Development Environment • http://bit.ly/spappdevenv • Office Developer Tools for Visual Studio 2012 • http://bit.ly/spapptools
  • 14. Decisions • Office 365 or On-Premise? • If Office 365, Visual Studio 2012 • If On-Premise then build your SharePoint 2013 Dev Server • Windows Server 2012 or Windows Server 2008 R2 SP1 • http://msdn.microsoft.com/en-us/library/fp161179.aspx • http://msdn.microsoft.com/en-us/library/fp179923.aspx • Andrew Connell’s Critical Path Training • SharePoint 2013 Setup Guide for Developers • http://bit.ly/cp2013setup
  • 15. App Packaging • Start with Visual Studio 2012 Project Template • .APP • Contains AppManifest.xml • Set Permission Requests for your App • Start Page • Client ID • App Icon Image File • You can unpack the .APP by renaming .ZIP
  • 16. Demo • Using Visual Studio to create the App Manifest • Explore Contents
  • 17. Security • Client Secret vs Certificate • Client Secret requires SharePoint is farm connected to ACS • Azure ACS (Access Control Service) • Office 365 is already connected to ACS • AppManifest.xml (.APP) • Contains permissions • OAuth • TokenHelper.cs (runs on the Provider) • Helps you manage requests for app tokens • If you are developing in another language you will need to implement this yourself
  • 18. OAuth Example TokenHelper.TrustAllCertificates(); string contextTokenString = TokenHelper.GetContextTokenFromRequest(Request); if (contextTokenString != null) { contextToken = TokenHelper.ReadAndValidateContextToken( contextTokenString, Request.Url.Authority); sharepointUrl = new Uri(Request.QueryString["SPHostUrl"]); accessToken = TokenHelper.GetAccessToken( contextToken, sharepointUrl.Authority).AccessToken; CSOM.CommandArgument = accessToken; }
  • 19. CSOM • Client Side Object Model • Rich improvements over 2012 • .NET version • JavaScript version • http://bit.ly/csom2013
  • 20. CSOM Example protected void CSOM_Click(object sender, EventArgs e) { string commandAccessToken = ((LinkButton)sender).CommandArgument; RetrieveWithCSOM(commandAccessToken); WebTitleLabel.Text = siteName; CurrentUserLabel.Text = currentUser; UserList.DataSource = listOfUsers; UserList.DataBind(); ListList.DataSource = listOfLists; ListList.DataBind(); } http://bit.ly/spappbasic
  • 21. CSOM Example ClientContext clientContext = TokenHelper.GetClientContextWithAccessToken( sharepointUrl.ToString(), accessToken); //Load the properties for the web object. Web web = clientContext.Web; clientContext.Load(web); clientContext.ExecuteQuery(); //Get the site name. siteName = web.Title; //Get the current user. clientContext.Load(web.CurrentUser); clientContext.ExecuteQuery(); currentUser = clientContext.Web.CurrentUser.LoginName; //Load the lists from the Web object. ListCollection lists = web.Lists; clientContext.Load<ListCollection>(lists); clientContext.ExecuteQuery();
  • 22. Scope of Access • What can you get to from CSOM?
  • 23. Putting it all together • Generate Client ID and Client Secret • Generated by form on SharePoint Online • https://<your site>/_layouts/15/appregnew.aspx • APP Manifest and Icon packaged in .APP file • Includes Permission Requests • Includes Client ID • Deployed to SharePoint • Your app is deployed to Azure, etc… • ClientID and ClientSecret • Your app receives Token from SharePoint user request • Your app uses Token to call CSOM
  • 24. Review • SharePoint has completely new Development Model • Leverage existing understanding with CSOM • Leverage existing other technology knowledge • Update many customers (or Farms) at once • Costs and Benefits of being a Provider • Security with OAuth • Package and Deploy to Store
  • 25. Resources • My Blog for Slides, Questions, and Follow up information • http://bit.ly/tcrowell • Pluralsight Videos by Andrew Connell • Over 12 hours of Video • http://bit.ly/acplural • Microsoft MSDN Documentation • http://bit.ly/spappmsdn • CloudShare for developer and test hosting • http://www.cloudshare.com/
  • 26. More Resources • Steve Fox’s Blog • Create a free Azure Web Site to develop Provider Hosted App • http://bit.ly/sfoxpart1 • http://bit.ly/sfoxpart2 • Chris Johnson's loosely typed thoughts… • Build a SharePoint Provider Hosted App in 5 mins • http://bit.ly/spapp5min
  • 27. Thank You Developing a Provider Hosted SharePoint App Presented by Talbott Crowell @talbott Questions?