extending sharepoint, lync and exchange with a custom wopi ... · wopi server iframe: wopi client...

28
Extending SharePoint, Lync and Exchange with a custom WOPI Client DEV205 Wictor Wilén

Upload: others

Post on 09-Oct-2020

19 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Extending SharePoint, Lync and Exchange with a custom WOPI ... · WOPI Server IFrame: WOPI Client • WOPI Server generates an Access Token and an id for the user and file • WOPI

Extending SharePoint, Lync and

Exchange with a custom WOPI

Client

DEV205

Wictor Wilén

Page 2: Extending SharePoint, Lync and Exchange with a custom WOPI ... · WOPI Server IFrame: WOPI Client • WOPI Server generates an Access Token and an id for the user and file • WOPI

Wictor Wilén, MCA, MCSM, MCM, MVP

Connecta AB, Sweden

http://www.connecta.se

http://www.wictorwilen.se

[email protected]

@wictor

Author of SharePoint 2010 Web Parts in

Action and co-author of Inside SharePoint

2013

Page 3: Extending SharePoint, Lync and Exchange with a custom WOPI ... · WOPI Server IFrame: WOPI Client • WOPI Server generates an Access Token and an id for the user and file • WOPI

Takeway from this session

I want you to learn and understand the

WOPI protocol and how it can enhance

and extend your SharePoint solutions

Page 4: Extending SharePoint, Lync and Exchange with a custom WOPI ... · WOPI Server IFrame: WOPI Client • WOPI Server generates an Access Token and an id for the user and file • WOPI

Agenda

WOPI this and WOPI that

[MS-WOPI]

OpenWOPI

Build a WOPI client

Discovery

Client

SharePoint 2013 Extensions

Page 5: Extending SharePoint, Lync and Exchange with a custom WOPI ... · WOPI Server IFrame: WOPI Client • WOPI Server generates an Access Token and an id for the user and file • WOPI

Office Web Apps…

Office Web Apps 2010

SharePoint 2010 Service

Application

SharePoint 2010 only

Not customizable,

extendable and almost

never updated

docs.com

skydrive.live.com

Office Web Apps Server 2013

WAC Server 2013

Standalone

Shared with SharePoint,

Exchange and Lync

Based on the open [MS-

WOPI] protocol

Page 6: Extending SharePoint, Lync and Exchange with a custom WOPI ... · WOPI Server IFrame: WOPI Client • WOPI Server generates an Access Token and an id for the user and file • WOPI

[MS-WOPI]

Web Application Open Platform Interface

http://askwictor.com/WOPI

Almost fully documented

No licensing

REST like protocol

Page 7: Extending SharePoint, Lync and Exchange with a custom WOPI ... · WOPI Server IFrame: WOPI Client • WOPI Server generates an Access Token and an id for the user and file • WOPI

Principles

Security

Discovery Client Server

Page 8: Extending SharePoint, Lync and Exchange with a custom WOPI ... · WOPI Server IFrame: WOPI Client • WOPI Server generates an Access Token and an id for the user and file • WOPI

WOPI Client

Provide a Discovery endpoint

Reads information about files and folders

Reads content of files and folders

Writes content of files and folders

Office Web Apps 2013 is a WOPI Client

Page 9: Extending SharePoint, Lync and Exchange with a custom WOPI ... · WOPI Server IFrame: WOPI Client • WOPI Server generates an Access Token and an id for the user and file • WOPI

WOPI Server/Apps

Reads the WOPI Client Discovery

endpoint

Responds to requests from the WOPI

Client

Never initiates communication with the

WOPI Client

SharePoint, Lync and Exchange 2013 are

WOPI Servers

Page 10: Extending SharePoint, Lync and Exchange with a custom WOPI ... · WOPI Server IFrame: WOPI Client • WOPI Server generates an Access Token and an id for the user and file • WOPI

Discovery

http[s]://<server>/hosting/discovery

HTTP/1.1 GET Request

<net-zone>

<app name=“Word”>

– <action ext=“docx” name=“edit” urlsrc=“...”>

<proof-key>

Page 11: Extending SharePoint, Lync and Exchange with a custom WOPI ... · WOPI Server IFrame: WOPI Client • WOPI Server generates an Access Token and an id for the user and file • WOPI

Introducing OpenWOPI

A free and open WOPI Client

Including extensions for SharePoint 2013

Available on Codeplex this week

openwopi.codeplex.com

ASP.NET MVC4 based

Let’s build it…

Page 12: Extending SharePoint, Lync and Exchange with a custom WOPI ... · WOPI Server IFrame: WOPI Client • WOPI Server generates an Access Token and an id for the user and file • WOPI

WOPI DISCOVERY

Implementing the WOPI Discovery process in the OpenWOPI

Client

Page 13: Extending SharePoint, Lync and Exchange with a custom WOPI ... · WOPI Server IFrame: WOPI Client • WOPI Server generates an Access Token and an id for the user and file • WOPI

Client and Server

Communication

WOPI Server

IFrame: WOPI Client

• WOPI Server generates an Access

Token and an id for the user and file

• WOPI Server renders an IFrame using

the action urlsrc and standard parameters

(GET) [friendly url]

• WOPI Client requests file info (GET)

• Passing unmodified Access Token and id

• WOPI Client requests file content (GET)

• Passing unmodified Access Token and id

• WOPI Client renders document

• Other WOPI Operations (GET, POST…)

Page 14: Extending SharePoint, Lync and Exchange with a custom WOPI ... · WOPI Server IFrame: WOPI Client • WOPI Server generates an Access Token and an id for the user and file • WOPI

WOPI Client Requests

Four request types

Must be implemented by the WOPI Server

http[s]://<server>/<…>/wopi*/files/<id>

File-level operations

http[s]://<server>/<…>/wopi*/files/<id>/contents

Content operations

http[s]://<server>/<…>/wopi*/folders/<id>

Folder-level operations

http[s]://<server>/<…>/wopi*/folders/<id>/children

Files and Folders within a folder

Page 15: Extending SharePoint, Lync and Exchange with a custom WOPI ... · WOPI Server IFrame: WOPI Client • WOPI Server generates an Access Token and an id for the user and file • WOPI

Request and Response details

HTTP Headers

MUST

– Authorization

MAY

– X-WOPI-ClientVersion

– X-WOPI-ServerVersion

– X-WOPI-Proof / X-WOPI-ProofOld

– X-WOPI-CorrelationID

– X-WOPI-*

– …

Page 16: Extending SharePoint, Lync and Exchange with a custom WOPI ... · WOPI Server IFrame: WOPI Client • WOPI Server generates an Access Token and an id for the user and file • WOPI

Access Tokens and security

Access Token <token>

Must be present on all Requests as the Authorization header

Generated by the WOPI Server

WOPI Client doesn’t have to “understand” it

Should expire

Should be scoped to a user and a set of resources

File or folder id <id>

Must be unique

Provided through the initial action request

(urlsrc)

Page 17: Extending SharePoint, Lync and Exchange with a custom WOPI ... · WOPI Server IFrame: WOPI Client • WOPI Server generates an Access Token and an id for the user and file • WOPI

WOPI Client Security

The Proof Key

Defined in the Discovery message

Not required

Used by Server to decrypt HTTP Headers

X-WOPI-Proof

X-WOPI-ProofOld

SharePoint always requires this!

Page 18: Extending SharePoint, Lync and Exchange with a custom WOPI ... · WOPI Server IFrame: WOPI Client • WOPI Server generates an Access Token and an id for the user and file • WOPI

SENDING WOPI REQUESTS

Page 19: Extending SharePoint, Lync and Exchange with a custom WOPI ... · WOPI Server IFrame: WOPI Client • WOPI Server generates an Access Token and an id for the user and file • WOPI

Actions

Scoped to an app

Specifies urlsrc so Server can initiate

request

Specifies name (type) and extension

Page 20: Extending SharePoint, Lync and Exchange with a custom WOPI ... · WOPI Server IFrame: WOPI Client • WOPI Server generates an Access Token and an id for the user and file • WOPI

File operations

http[s]://<server>/<…>/wopi*/files/<id>

CheckFileInfo (GET)

PutRelativeFile (POST + X-WOPI-*)

Lock, Unlock, RefreshLock, UnlockAndRelock (POST + X-

WOPI-*)

DeleteFile (POST + X-WOPI-*)

ExecuteCellStorage* (POST + X-WOPI-*)

ReadSecureStore (POST + X-WOPI-*)

Get/RevokeRestrictedLink (POST + X-WOPI-*)

http[s]://<server>/<…>/wopi*/files/<id>/contents

GetFile (GET)

PutFile (POST)

Page 21: Extending SharePoint, Lync and Exchange with a custom WOPI ... · WOPI Server IFrame: WOPI Client • WOPI Server generates an Access Token and an id for the user and file • WOPI

RETRIEVING A FILE

Page 22: Extending SharePoint, Lync and Exchange with a custom WOPI ... · WOPI Server IFrame: WOPI Client • WOPI Server generates an Access Token and an id for the user and file • WOPI

Action values

view

edit

mobileview

interactivePreview

embedview

present

formsubmit

formedit

Page 23: Extending SharePoint, Lync and Exchange with a custom WOPI ... · WOPI Server IFrame: WOPI Client • WOPI Server generates an Access Token and an id for the user and file • WOPI

UPDATING A FILE

Page 24: Extending SharePoint, Lync and Exchange with a custom WOPI ... · WOPI Server IFrame: WOPI Client • WOPI Server generates an Access Token and an id for the user and file • WOPI

Integration with SharePoint

Add-SPWOPIBinding

Previews

Document Libraries

– JavaScript (undocumented territory)

Search Center

– Display Template

Page 25: Extending SharePoint, Lync and Exchange with a custom WOPI ... · WOPI Server IFrame: WOPI Client • WOPI Server generates an Access Token and an id for the user and file • WOPI

Exchange and Lync integration

Only allows one WOPI Client

Exchange 2013

PowerShell

Lync 2013

The Topology Builder

Page 26: Extending SharePoint, Lync and Exchange with a custom WOPI ... · WOPI Server IFrame: WOPI Client • WOPI Server generates an Access Token and an id for the user and file • WOPI

PREVIEWS FOR REAL IN

SHAREPOINT 2013

Page 27: Extending SharePoint, Lync and Exchange with a custom WOPI ... · WOPI Server IFrame: WOPI Client • WOPI Server generates an Access Token and an id for the user and file • WOPI

Summary

[MS-WOPI] is an open specification

Built on the HTTP protocol

You can create custom viewers and

editors

OpenWOPI!

openwopi.codeplex.com

Page 28: Extending SharePoint, Lync and Exchange with a custom WOPI ... · WOPI Server IFrame: WOPI Client • WOPI Server generates an Access Token and an id for the user and file • WOPI

Thank you for attending!

You’ve been an awesome crowd!

Slides and Open WOPI links at

http://askwictor.com/spevo13-dev205