(Rob) Contoso photo Contoso ? Contoso photo Contoso.

54

Transcript of (Rob) Contoso photo Contoso ? Contoso photo Contoso.

Page 1: (Rob) Contoso photo Contoso ? Contoso photo Contoso.
Page 2: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

Developing Hybrid apps for SharePointRob HowardProgram Manager, SharePoint Developer

SPC088

Page 3: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

• Review of SharePoint app authentication• Online, on-prem, and hybrid scenarios• Access tokens and issuers• Configuring a hybrid SharePoint

environment• Creating a hybrid SharePoint app

Agenda

Page 4: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

App authentication review

Page 5: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

(Rob)

Page 6: (Rob) Contoso photo Contoso ? Contoso photo Contoso.
Page 7: (Rob) Contoso photo Contoso ? Contoso photo Contoso.
Page 8: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

Contoso photo

Page 9: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

Contoso photo

Contoso

Page 10: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

?Contoso photo

Contoso

Page 11: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

Contoso photo

Contoso

Page 12: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

View

View

Contoso photo

Contoso

Page 13: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

View, Upload, Tag, Comment

View, Upload, Tag, Comment

Contoso photo

Contoso

Page 14: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

View, Upload, Tag, Comment, Change Password

View, Upload, Tag, Comment, Change Password

Contoso photo

Contoso

Page 15: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

View, Upload, Tag, Comment, Change Password

Contoso photo

Contoso

Page 16: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

View, Upload, Tag, Comment, Change Password

Contoso photo

Contoso

Page 17: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

View, Upload, Tag, Comment, Change Password

Contoso photo

Contoso

Page 18: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

View, Upload, Tag, Comment, Change Password

View

Contoso photo

Contoso

Page 19: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

View, Upload, Tag, Comment, Change Password

View

Contoso photo

Contoso

Page 20: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

SharePoint

SharePoint 2007

Sandbox

SharePoint 2010

SharePoint

Azure, IIS, LAMP, etc…

_api

SharePoint 2013

Cloud App Model: Past and Present

Page 21: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

Hybrid app scenarios

Page 22: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

• Selling a product built from a single codebase to on-prem customers and O365 customers

• Creating an app that work both online and on-prem for customers with a presence in both

• Connecting an app running in the cloud to SharePoint running on-prem or vice versa

Hybrid Scenarios

Page 23: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

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

Clo

ud

Azure AD

AppOffice 365

Page 24: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

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

On-P

rem

Clo

ud

Azure AD

AppOffice 365

AppSharePoi

nt

Page 25: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

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 26: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

• No autohosted apps in on-prem farms• Cross-firewall server-side calls• Azure AD is only available as part of O365

Hybrid app challenges

Page 27: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

SharePoint“Host” Web

App Web JavaScript

App Authentication

SharePoint“AppWeb”

Firewall

Page 28: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

SharePoint“Host” Web

App Authentication

JavaScript(cross domain)

SharePoint“AppWeb”

Firewall

Page 29: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

Demo: SharePoint-hosted apps on-prem and onlineRob Howard

Page 30: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

Firewall

SharePoint“Host” Web

App Authentication

OAuth

SharePoint“AppWeb”

Page 31: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

Access tokens and issuers

SharePointRemote App

Access Token

Page 32: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

Access tokens and issuers

SharePointRemote App

Trusted SecurityToken Issuer

Access Token

Page 33: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

OAuth-authenticated requestPOST https://fortworth.sharepoint.com/_vti_bin/client.svc/ProcessQuery HTTP/1.1Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ik5HVEZ2ZEs…Content-Type: text/xmlHost: fortworth.sharepoint.comContent-Length: 606Expect: 100-continueAccept-Encoding: gzip, deflate

<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="15.0.0.0"…

Access token

Page 34: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

Decoded access token { "typ":JWT "alg":RS256 "x5t":34-64-C5-BD-D2-BE-7F-2B-61-12-E2-F0-8E-9C-00-24-E3-3D-9F-E0 } { "aud":00000003-0000-0ff1-ce00-000000000000/fortworth.sharepoint.com@2c439330-685e-4c13-817b-e057b9637ad0 "iss":00000001-0000-0000-c000-000000000000@2c439330-685e-4c13-817b-e057b9637ad0 "nbf":2012-11-09 16:07:26Z (11/9/2012 8:07:26 AM) - 1352477246 "exp":2012-11-10 04:07:26Z (11/9/2012 8:07:26 PM) - 1352520446 "nameid":10037ffe831d4d4c "actor":e1ec2ca5-301c-4275-add3-f1f7252f3b4b@2c439330-685e-4c13-817b-e057b9637ad0 "identityprovider":urn:federation:microsoftonline }

Thumbprint

Issuer

Page 35: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

Decoded access token { "typ":JWT "alg":RS256 "x5t":34-64-C5-BD-D2-BE-7F-2B-61-12-E2-F0-8E-9C-00-24-E3-3D-9F-E0 } { "aud":00000003-0000-0ff1-ce00-000000000000/fortworth.sharepoint.com@2c439330-685e-4c13-817b-e057b9637ad0 "iss":00000001-0000-0000-c000-000000000000@2c439330-685e-4c13-817b-e057b9637ad0 "nbf":2012-11-09 16:07:26Z (11/9/2012 8:07:26 AM) - 1352477246 "exp":2012-11-10 04:07:26Z (11/9/2012 8:07:26 PM) - 1352520446 "nameid":10037ffe831d4d4c "actor":e1ec2ca5-301c-4275-add3-f1f7252f3b4b@2c439330-685e-4c13-817b-e057b9637ad0 "identityprovider":urn:federation:microsoftonline }

Audience

Page 36: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

Decoded access token { "typ":JWT "alg":RS256 "x5t":34-64-C5-BD-D2-BE-7F-2B-61-12-E2-F0-8E-9C-00-24-E3-3D-9F-E0 } { "aud":00000003-0000-0ff1-ce00-000000000000/fortworth.sharepoint.com@2c439330-685e-4c13-817b-e057b9637ad0 "iss":00000001-0000-0000-c000-000000000000@2c439330-685e-4c13-817b-e057b9637ad0 "nbf":2012-11-09 16:07:26Z (11/9/2012 8:07:26 AM) - 1352477246 "exp":2012-11-10 04:07:26Z (11/9/2012 8:07:26 PM) - 1352520446 "nameid":10037ffe831d4d4c "actor":e1ec2ca5-301c-4275-add3-f1f7252f3b4b@2c439330-685e-4c13-817b-e057b9637ad0 "identityprovider":urn:federation:microsoftonline }

Page 37: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

Decoded access token { "typ":JWT "alg":RS256 "x5t":34-64-C5-BD-D2-BE-7F-2B-61-12-E2-F0-8E-9C-00-24-E3-3D-9F-E0 } { "aud":00000003-0000-0ff1-ce00-000000000000/fortworth.sharepoint.com@2c439330-685e-4c13-817b-e057b9637ad0 "iss":00000001-0000-0000-c000-000000000000@2c439330-685e-4c13-817b-e057b9637ad0 "nbf":2012-11-09 16:07:26Z (11/9/2012 8:07:26 AM) - 1352477246 "exp":2012-11-10 04:07:26Z (11/9/2012 8:07:26 PM) - 1352520446 "nameid":10037ffe831d4d4c "actor":e1ec2ca5-301c-4275-add3-f1f7252f3b4b@2c439330-685e-4c13-817b-e057b9637ad0 "identityprovider":urn:federation:microsoftonline }

Page 38: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

Decoded access token { "typ":JWT "alg":RS256 "x5t":34-64-C5-BD-D2-BE-7F-2B-61-12-E2-F0-8E-9C-00-24-E3-3D-9F-E0 } { "aud":00000003-0000-0ff1-ce00-000000000000/fortworth.sharepoint.com@2c439330-685e-4c13-817b-e057b9637ad0 "iss":00000001-0000-0000-c000-000000000000@2c439330-685e-4c13-817b-e057b9637ad0 "nbf":2012-11-09 16:07:26Z (11/9/2012 8:07:26 AM) - 1352477246 "exp":2012-11-10 04:07:26Z (11/9/2012 8:07:26 PM) - 1352520446 "nameid":10037ffe831d4d4c "actor":e1ec2ca5-301c-4275-add3-f1f7252f3b4b@2c439330-685e-4c13-817b-e057b9637ad0 "identityprovider":urn:federation:microsoftonline }

Page 39: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

Decoded access token { "typ":JWT "alg":RS256 "x5t":34-64-C5-BD-D2-BE-7F-2B-61-12-E2-F0-8E-9C-00-24-E3-3D-9F-E0 } { "aud":00000003-0000-0ff1-ce00-000000000000/fortworth.sharepoint.com@2c439330-685e-4c13-817b-e057b9637ad0 "iss":00000001-0000-0000-c000-000000000000@2c439330-685e-4c13-817b-e057b9637ad0 "nbf":2012-11-09 16:07:26Z (11/9/2012 8:07:26 AM) - 1352477246 "exp":2012-11-10 04:07:26Z (11/9/2012 8:07:26 PM) - 1352520446 "nameid":10037ffe831d4d4c "actor":e1ec2ca5-301c-4275-add3-f1f7252f3b4b@2c439330-685e-4c13-817b-e057b9637ad0 "identityprovider":urn:federation:microsoftonline }

Page 40: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

Access tokens and issuers

SharePointRemote App

Trusted SecurityToken Issuer

Access Token

Page 41: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

Access tokens and issuers (Online)

SharePoint Online

Remote App

Trusted SecurityToken Issuer (ACS)

Access Token

Azure AD

ACS Proxy

Page 42: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

Access tokens and issuers (On-Prem)

SharePoint On-Prem

Remote App

Trusted SecurityToken Issuer (ACS)

Access Token

Azure AD

ACS Proxy

Page 43: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

Demo: Building a high-trust app on-premRob Howard

Page 44: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

Access tokens and issuers (On-Prem)

SharePointRemote App

Trusted SecurityToken Issuer

Access Token

Page 45: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

Access tokens and issuers (Hybrid)

SharePoint On-Prem

Remote App

Trusted SecurityToken Issuer (ACS)

Access Token

Azure AD

ACS Proxy

Page 46: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

Demo: Configuring ACS as a trusted issuer on-premRob Howard

Page 47: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

Access tokens and issuers (On-Prem)

SharePointRemote App

Trusted SecurityToken Issuer

Access Token

Page 48: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

Access tokens and issuers (Online)

SharePointRemote App

Trusted SecurityToken Issuer (ACS)

Access Token

Azure AD

ACS Proxy

Page 49: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

Azure AD

Creating a hybrid app

SharePointRemote App

Trusted SecurityToken Issuer (ACS)

SharePoint

Trusted SecurityToken Issuer

Page 50: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

Demo: Apps that use both high-trust and 3-legged OAuthRob Howard

Page 51: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

Remote App

Remote App

Azure AD

Access tokens and issuers (Hybrid)

SharePoint Online

Remote App

Trusted SecurityToken Issuer (ACS)

SharePoint On-prem

Trusted SecurityToken Issuer

Page 52: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

• The new cloud app model is designed to work both on-prem and in the cloud

• Use high-trust (S2S) in pure on-prem environments

• Use a hybrid configuration to connect on-prem SharePoint farms to apps in the cloud

• Build hybrid apps that can work in on-prem and online environments with a single codebase

Takeaways

Page 53: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

Evaluate this session now on MySPC using your laptop or mobile device: http://myspc.sharepointconference.com

MySPC

Page 54: (Rob) Contoso photo Contoso ? Contoso photo Contoso.

© 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.