SharePoint apps: data access options

27
apps: data access options by SERGEI SERGEEV, SHAREPOINT DEVELOPER

Transcript of SharePoint apps: data access options

SharePoint apps: data access options

by SERGEI SERGEEV, SHAREPOINT DEVELOPER

Agenda 1. Review possible data access options

(remote to SharePoint and SharePoint to remote).

2. DEMOs.3. Pros & cons for each option. 4. How to select right data access option.

List of different data access optionsRemote web to SharePoint host.NET CSOM

Server REST

JavaScript CSOM

JavaScript REST

SharePoint host to remote webWeb Proxy JSOM

Web Proxy REST

Custom Proxy page

BONUS – Azure AD

Remote web to host

DEMO .NET CSOM vs server REST

Remote web to host .NET CSOM PROS

+ .NET code+ results as objects+ batch calls+ app only context+ code protection (reverse engineering)+ remote events (.NET)

CONS - .NET code only - testability - performance (vs cross-domain library) - portability - results as objects

Remote web to host server REST PROS

+ any language + JSON, XML + testability + app only context + portability + code protection (reverse engineering)

+ remote events (.NET)

CONS - performance (vs cross-domain library)

- no batch support? - CSOM isn’t fully covered

REST API batching implemented!

Office 365 Roadmap

Cross-domain library (SP.RequestExecutor.js)

- same origin policy - allows to perform cross domain calls

Cross-domain library. How it works

Remote web to host

DEMO JavaScript CSOM vs client REST

(cross-domain library)

Cross-domain library (SP.RequestExecutor.js) - not an original (xdomain.js) - alternatives (cors, jsonp)

Remote web to host JavaScript CSOM and client RESTPROS

+ fast+ testability?+ portability+ allows to bypass firewall behind remote app and SharePoint

CONS - no app only context - no remote events - intellectual protection - IE security zones (link)

IE security zone issue

IE security zone issue

App web to remote web (web proxy).How it works

App web to remote web (web proxy)

DEMO JavaScript CSOM vs client REST

(web proxy)

App web to remote web (web proxy)

Prerequisites: AppManifest’s Remote Endpoints

You can chose your own method, cors, jsonp (if you can access the server)

App web to remote web (web proxy)PROS

+ fast to SharePoint (you are in the app web domain already)+ testability?+ portability

CONS - can be slow - no authentication - response limit – 200kb (can be customized for on premise)

- remote endpoint should be publicly available

- ports limit – 80, 43, 7000-10000

App web to remote web (custom proxy page)

DEMO Access remote web data through

custom proxy page

App web to remote web (custom proxy page)PROS

+ fast to SharePoint (you are in the app web domain already)+ fast to remote web (because of iframe)+ testability

CONS - IE security zones (link) - no app only context - no remote events - intellectual protection

Remote web to host with SharePoint hosted app

DEMO Access SharePoint data from remote

web with SharePoint hosted app

BONUS. Azure AD

DEMO Windows Forms SharePoint app

What method is right for me?

It depends:- analyze your requirements- keep in mind all cons & pros for every method

Questions?

Thanks!