I try to get the preview of Documents working when documents are hosted in SP2010 and crawled by SP2013.


To render a document, the index creates a link that returns an iframe that contains the preview of the document. this works perfectly because SP2013 and OWA2013 use oAuth to authorize the request - this happens in the background. In other words: Your browser generates the oAuth token, hands this over to the OWA server. The OWA server than hands this token to SP2013 and can fetch the document "on behalf of".


SharePoint 2010 does not support oAuth.


Is it possible to create a custom webservice/http handler that gets the request from the OWA? This custom module would get the oAuth token, would check back back at the SP2013 what user is behind the token. With the login of the user it then resolves the user login and SP2010 can then decide whether the user is allowed to see the document or not.

Theoretically this should work - any arguments why it shouldn't?

Update 1 - 11/21/2013 What I got so far:

When I open the URL http://owa2013.demo.com/op/view.aspx?src=[Encoded Url of my handler + document to open as query Parameter] OWA opens my handler and passes the query string parameter containing the url of my document sitting in the sp2010 host. So far so good.

Now I need to create:

  1. a new wopiframe3.aspx that creates the fancy oAuth token and post this along to OWA - this is because I cant convince the original wopiframe to call a url with a protocol, it only opens relative urls. My hope is that this token then will be relayed to my handler.

  2. After this I need a TokenHandler that runs in .net 3.5 so I can host my new handler in SP2010 - with this tokenhandler I can then get the users login from SP2013 and verify that he can access the document in SP2010.

More complicated than I thought. Is it really that complicated?

  • 1
    Doesn't sound overly complicated, but it does seem like a shame that I don't think after all the research there is a much easier way.
    – Hugh Wood
    Nov 21 '13 at 9:45
  • Thats a true bummer - but I think because of that complexity its the reason why its not working out of the box. Same applies for Documents sitting on a FILESHARE - no preview, very bad! Nov 21 '13 at 10:40
  • I think you would have to make your own preview method perhaps, I will think about these issues maybe eventually something will come to light. But for me I'm in SPO so I have a totally different ballgame at the moment.
    – Hugh Wood
    Nov 21 '13 at 12:47
  • SPO => no chance. On Prem I came up with two ideas. Nov 21 '13 at 13:21
  • 1
    SPO how much we betting I can do it :P
    – Hugh Wood
    Nov 21 '13 at 14:54

From the book

Developing Microsoft SharePoint Applications Using Windows Azure by Steve Fox take a look at using


It has a how to get started guide and provides a very flexible layer for you to work with.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.