68
Building end-to-end apps for SharePoint with Windows Azure and Windows 8 Rob Howard, Donovan Follette Sr. Program Manager, Sr. Technical Evangelist 3-022

Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

Embed Size (px)

Citation preview

Page 1: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

Building end-to-end apps for SharePoint with Windows Azure and Windows 8Rob Howard, Donovan FolletteSr. Program Manager, Sr. Technical Evangelist3-022

Page 2: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

Demo end-to-end solutionIntroduction to _apiMeet the new App PrincipalRemote Event Receivers

Agenda

Page 3: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

With the new cloud app model for SharePoint and its rich service APIs, your apps can now consume SharePoint better than ever before.

Key Takeaway

Page 4: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

Scenario Overview

Business:Company wishes to create a mobile enabled toolset for sales personnel to efficiently respond to sales leads and win business

Technical:Company wants a 100% cloud-based solution and use desktop applications and mobile devices to access the toolset

Page 5: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

Windows 8 Application

Microsoft Word with Apps For Office

Internal O365 SharePoint Site

Windows Azure Cloud Services

Windows Azure Workflow Server

Public O365 SharePoint Site Windows

Azure SQL Database

Clients (Desktop/Tablet/Mobile)

Cloud

• View / approve SOWs• Display Excel Services

charts in Word

• View client companies• View sales leads• Receive toast and tile

and raw notifications• View Excel Services

charts• Create estimates

• Contact internal sales personnel to follow up on requests for quotes

• Contact vendors to follow up on requests for quotes

• Approve SOWs• Display, Create, Update,

Delete Sales Leads• Store Excel Documents• Store SOWs• Host team sites for projects• BCS External List

• Submit requests for quote

• Send notifications• Create SOWs• Update data in Excel

documents• Create SharePoint project

sites

• Facilitate SOW creation, approval, submission, and follow up tasks

• Store sales request data

Windows AzureAccess Control Service• OAuth

Page 6: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

Demo using Windows 8, Windows Azure SQL Database, Web Sites and Access Control Services

Lead Tracking app for SharePoint Online

Page 7: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

Introduction to _api

Page 8: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

Introducing the all new _api

_APIClient/Server/Mobile Symmetrical

OAuth Enabled

2,000+ Classes

Declarative, Remote EventsFully Remote

6,000+ MembersODataJQuery Compatible

Private and Public Clouds

JSON

Page 9: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

JavaScript Library

Silverlight Library

.Net CLR Library

Custom Client Code

Client

SharePoint

_api

SharePoint Foundatio

n

Execute Query

SharePoint 2013 and SharePoint Online _api

OData / REST

User Profile

Search

Taxonomy

Feeds More…

Page 10: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

Consistent Access to Services

API REST URL Script Client Namespace

Web http://weburl/_api/Web SP Microsoft.SharePoint.Client

Search http://weburl/_api/Search SP.Search Microsoft.SharePoint.Client.Search

Taxonomy http://weburl/_api/Taxonomy

SP.Taxonomy

Microsoft.SharePoint.Client.Taxonomy

Social http://weburl/_api/Social SP.Social Microsoft.SharePoint.Client.Social

Page 11: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

Consistent UsageREST/ODatahttps://contoso.sharepoint.com/_api/web/Title

Managed CodeClientContext ctx = new ClientContext("https://contoso.sharepoint.com");ctx.Load(ctx.Web.Title);ctx.ExecuteQuery();

JavaScriptvar ctx = new SP.ClientContext("https://contoso.sharepoint.com");ctx.load(ctx.get_web().get_title());ctx.executeQueryAsync();

Page 12: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

Base endpoint

GET http://<weburl>/_api

Get the web’s title

GET http://<weburl>/_api/Web/title

Get the collection of lists in the web

GET http://<weburl>/_api/Web/lists

Get the lists in the web with a BaseTemplate of 104 (announcement lists)

GET http://<weburl>/_api/Web/lists?$filter=BaseTemplate eq 104

Create a new list

POST http://<weburl>/_api/web/Lists

Body:

{ 'd' : {'__metadata': {'type': 'SP.List'},'Title': 'My New List,'Url': 'newlist','TemplateType': 101,'TemplateFeatureId': '00BFEA71-E717-4E80-AA17-D0C71B360101'}}

Sample REST / OData Calls

Page 13: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

demo

SharePoint _API

Page 14: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

Meet the App Principals

Page 15: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

(Rob)

Page 16: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server
Page 17: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server
Page 18: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

Contoso photo

Page 19: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

Contoso photo

Contoso

Page 20: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

?Contoso photo

Contoso

Page 21: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

Contoso photo

Contoso

Page 22: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

View

View

Contoso photo

Contoso

Page 23: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

View, Upload, Tag, Comment

View, Upload, Tag, Comment

Contoso photo

Contoso

Page 24: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

View, Upload, Tag, Comment, Change Password

View, Upload, Tag, Comment, Change Password

Contoso photo

Contoso

Page 25: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

View, Upload, Tag, Comment, Change Password

Contoso photo

Contoso

Page 26: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

View, Upload, Tag, Comment, Change Password

Contoso photo

Contoso

Page 27: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

View, Upload, Tag, Comment, Change Password

Contoso photo

Contoso

Page 28: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

View, Upload, Tag, Comment, Change Password

View

Contoso photo

Contoso

Page 29: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

View, Upload, Tag, Comment, Change Password

View

Contoso photo

Contoso

Page 30: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

SharePoint

SharePoint 2007

Sandbox

SharePoint 2010

SharePoint

Azure, IIS, LAMP, etc…

_api

SharePoint 2013

App Model: Past, Present and Future

Page 31: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

What: The protocol to handle the authorization flow.Based on existing internet implementations

Why:Functionality

App and User identitiesEstablished model for granting app accessSimple

OtherEngineering efficienciesGood adoption

Clear architectural roadmap

OAuth 2.0

Page 32: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

32

User credentialsprovided?

Start

End

User only context

App only context

User + App

context

Anonymous context

App tokenprovided?

App tokenIncludes user?

AuthenticationYes

No

No No

Yes Yes

Page 33: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

SharePoint Context Token

SharePoint Server

App.com

Browser

Page 34: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

Browser

SharePoint Server

App.com

STS (ACS)

Page 35: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

Browser

SharePoint Server

1

App.com

STS (ACS)

1) User browses to a SharePoint page with an app from app.com on it

https://rhoward.sharepo

Page 36: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

Browser

SharePoint Server

1

App.com

2

STS (ACS)

2) SharePoint asks ACS to create and sign a token which contains context information (e.g. the current user) and an auth code

https://rhoward.sharepo

Page 37: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

Browser

SharePoint Server

1

App.com

2

STS (ACS)

3

3) ACS returns the signed context token

https://rhoward.sharepo

Page 38: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

Browser

SharePoint Server

1

App.com

2

STS (ACS)

3

4

4) SharePoint renders the page including an iframe, which will POST the context token to app.com

SP API Reviewhttps://rhoward.sharepo

POST https://app.com/…SPAppToken=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.e…

Page 39: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

Browser

SharePoint Server

1

5

App.com

2

STS (ACS)

3

4

5) The iframe causes the browser to request a page from app.com including the context token

SP API Reviewhttps://rhoward.sharepo

Page 40: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

Browser

SharePoint Server

1

5

App.com

2

STS (ACS)

3

4

6

6) App.com validates the signature on the context token, extracts the auth code, and uses its credentials to request an access token from ACS

SP API Reviewhttps://rhoward.sharepo

Page 41: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

Browser

SharePoint Server

1

5

App.com

2

STS (ACS)

3

4

6

7

7) Windows Azure Access Control Service (ACS) returns an access token

SP API Reviewhttps://rhoward.sharepo

Page 42: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

Browser

SharePoint Server

1

5

8

App.com

2

STS (ACS)

3

4

6

7

8) App.com makes a web service request to SharePoint, passing the access token

SP API Reviewhttps://rhoward.sharepo

Page 43: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

Browser

SharePoint Server

1

5

8

9

App.com

2

STS (ACS)

3

4

6

7

9) SharePoint returns information to App.com

SP API Reviewhttps://rhoward.sharepo

Page 44: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

Browser

SharePoint Server

1

10

5

8

9

App.com

2

STS (ACS)

3

4

6

7

10) App.com renders the iframe contents

SP API Reviewhttps://rhoward.sharepo

7 Unassigned Changes21 Pending Reviews17 Active API BugsNag Mail

Nag Mail

Auto-Assign

Page 45: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

demo

A basic remote app

Page 47: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

SharePoint 2013 & Windows Azure Workflow

People

Content

Events

Collab

Vis

ual S

tud

io

Sh

are

Poin

t D

esig

ner

SharePointWF3 Host

SharePoint OM

_API

Workflow Services Manager

MTW

AzureService Bus

AzureWorkflow

AzureAccess Control

OAuth2

Instances Interop

Deployment

Messaging

WF4 Service Application Proxy

Page 48: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

Remote Event Receivers

Page 49: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

Remote Event Receivers

App Server

Remote

Event

Push Notifications

Page 50: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

demo

Remote Event Receivers

Page 51: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

SharePoint 2013 has a broad, powerful set of service APIs available to clients of a comprehensive set of technologies

SharePoint 2013 independently authenticates both users and app principals

Using the deep set of APIs and standard web technologies you can build a new class of innovative productivity solutions by accessing SharePoint as a service

Takeaways

Page 52: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

• Today 12:00 PM – B92 Stinger – Developing an App for SharePoint Autohosted…

Related Sessions

Page 53: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

• http://dev.office.com

• http://blogs.msdn.com/b/officeapps

• http://dev.windows.com

• http://windowsazure.com

Office, SharePoint & More Resources Please submit sessions evals on the Build Windows 8 App

or at http://aka.ms/BuildSessions

Page 54: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Page 55: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

Overflow

Page 56: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

Two Aspects to Access Control

Authenticationverifying a claim made by a subject that it should be allowed to act on behalf of a given principal

Authorizationverifying that an authenticated subject has permission to perform certain operations or access specific resources

Page 57: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

SharePoint“Host” Web

App Web JavaScript

App Authentication

SharePoint“AppWeb”

Page 58: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

SharePoint“Host” Web

App Authentication

JavaScript(cross domain)

SharePoint“AppWeb”

Page 59: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

SharePoint“Host” Web

App Authentication

OAuth

SharePoint“AppWeb”

Page 60: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

App Identity Online and On-PremIn the cloudWindows Azure Active Directory (AD) comes with O365Apps use ‘3-legged’ OAuth

Azure AD

AppOffice 365

Clo

ud

Page 61: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

App Identity Online and On-PremIn the cloudWindows Azure AD comes with O365Apps use ‘3-legged’ OAuth

On-PremisesCert-based trustOn-prem to on-prem

AppSharePoi

nt

On-P

rem

Azure AD

AppOffice 365

Clo

ud

Page 62: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

App Identity Online and On-PremIn the cloudWindows Azure AD comes with O365Apps use ‘3-legged’ OAuth

On-PremisesCert-based trustOn-prem to on-prem

HybridUse O365 Azure AD with on-prem SPSupports marketplace and on-prem apps

Azure AD

AppOffice 365

AppSharePoi

nt

Clo

ud

On-P

rem

Page 63: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

Authorization

Page 64: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

Apps have Identity (separate from Users)Ex: Printing App is distinct from the user using the Printing app

Access is based on GrantsGrants are available to AccessCheckGrants have scopes and rightsEx: Printing App has READ right on “Picture Library”

AccessCheck makes a decision usingIdentities (User, Application)Resource Attributes (ACLs)Policies

User OnlyApp & UserApp Only

Authorization Logical Model

Page 65: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

Apps must request the permissions they require to run

Permission Requests

<AppPermissionRequests AllowAppOnlyPolicy="true"> <AppPermissionRequest Scope="http://sharepoint/content/sitecollection" Right="Read"/> <AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web/list" Right="Write"> <Property Name="BaseTemplateId" Value="101"/> </AppPermissionRequest> <AppPermissionRequest Scope="http://sharepoint/social/microfeed" Right="Manage"/> <AppPermissionRequest Scope="http://sharepoint/search" Right="Query"/></AppPermissionRequests>

Page 66: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

Permission Requests

Scope="http://sharepoint/content/sitecollection" Right="Read"/>

Product Permission ProviderSpecific component Capability

Page 67: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

Consent

App Name Here

Page 68: Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server

Available App PermissionsScope Right

http://sharepoint/content/tenant Read;Write;Manage;FullControlhttp://sharepoint/content/sitecollection Read;Write;Manage;FullControlhttp://sharepoint/content/sitecollection/web Read;Write;Manage;FullControlhttp://sharepoint/content/sitecollection/web/list Read;Write;Manage;FullControlhttp://sharepoint/bcs/connection Read

http://sharepoint/search QueryAsUserIgnoreAppPrincipal

http://sharepoint/projectserver Managehttp://sharepoint/projectserver/projects Read;Writehttp://sharepoint/projectserver/projects/project Read;Writehttp://sharepoint/projectserver/enterpriseresources Read;Writehttp://sharepoint/projectserver/statusing SubmitStatushttp://sharepoint/projectserver/reporting Readhttp://sharepoint/projectserver/workflow Elevatehttp://sharepoint/social/tenant Read;Write;Manage;FullControlhttp://sharepoint/social/core Read;Write;Manage;FullControlhttp://sharepoint/social/microfeed Read;Write;Manage;FullControlhttp://sharepoint/taxonomy Read;Write