Extending SharePoint, Lync and Exchange with a custom WOPI ... · WOPI Server IFrame: WOPI Client...
Transcript of Extending SharePoint, Lync and Exchange with a custom WOPI ... · WOPI Server IFrame: WOPI Client...
![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](https://reader034.fdocuments.in/reader034/viewer/2022051608/603bbb53dcc63828e230e64f/html5/thumbnails/1.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022051608/603bbb53dcc63828e230e64f/html5/thumbnails/2.jpg)
Wictor Wilén, MCA, MCSM, MCM, MVP
Connecta AB, Sweden
http://www.connecta.se
http://www.wictorwilen.se
@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](https://reader034.fdocuments.in/reader034/viewer/2022051608/603bbb53dcc63828e230e64f/html5/thumbnails/3.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022051608/603bbb53dcc63828e230e64f/html5/thumbnails/4.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022051608/603bbb53dcc63828e230e64f/html5/thumbnails/5.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022051608/603bbb53dcc63828e230e64f/html5/thumbnails/6.jpg)
[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](https://reader034.fdocuments.in/reader034/viewer/2022051608/603bbb53dcc63828e230e64f/html5/thumbnails/7.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022051608/603bbb53dcc63828e230e64f/html5/thumbnails/8.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022051608/603bbb53dcc63828e230e64f/html5/thumbnails/9.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022051608/603bbb53dcc63828e230e64f/html5/thumbnails/10.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022051608/603bbb53dcc63828e230e64f/html5/thumbnails/11.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022051608/603bbb53dcc63828e230e64f/html5/thumbnails/12.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022051608/603bbb53dcc63828e230e64f/html5/thumbnails/13.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022051608/603bbb53dcc63828e230e64f/html5/thumbnails/14.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022051608/603bbb53dcc63828e230e64f/html5/thumbnails/15.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022051608/603bbb53dcc63828e230e64f/html5/thumbnails/16.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022051608/603bbb53dcc63828e230e64f/html5/thumbnails/17.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022051608/603bbb53dcc63828e230e64f/html5/thumbnails/18.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022051608/603bbb53dcc63828e230e64f/html5/thumbnails/19.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022051608/603bbb53dcc63828e230e64f/html5/thumbnails/20.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022051608/603bbb53dcc63828e230e64f/html5/thumbnails/21.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022051608/603bbb53dcc63828e230e64f/html5/thumbnails/22.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022051608/603bbb53dcc63828e230e64f/html5/thumbnails/23.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022051608/603bbb53dcc63828e230e64f/html5/thumbnails/24.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022051608/603bbb53dcc63828e230e64f/html5/thumbnails/25.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022051608/603bbb53dcc63828e230e64f/html5/thumbnails/26.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022051608/603bbb53dcc63828e230e64f/html5/thumbnails/27.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022051608/603bbb53dcc63828e230e64f/html5/thumbnails/28.jpg)
Thank you for attending!
You’ve been an awesome crowd!
Slides and Open WOPI links at
http://askwictor.com/spevo13-dev205