Share via

Calling view.officeapps.live.com from an iframe

Anonymous
2022-05-10T08:14:22+00:00

Hello,

We are developing an application where we want to preview documents in an iframe using view.officeapps.live.com.

The documents are stored within the app but to make them publically available for view.ooficeapps.live.com we have to retrieve them via a REST API endpoint.

In an attempt to make the endpoint more secure we want to pass an authentication token along with the document ID.

The iframe URL looks like:

https://view.officeapps.live.com/op/embed.aspx?src='+$AbsolutePath

Where the $AbsolutePath is:

<application_url>/rest/previewservice/v1/preview?PreviewToken=<EncodedRandomString>&DocumentID=<id>

For some reason, the view.officeapps.live.com call works when we just pass the document ID as a parameter but not when we try to pass the authentication token too.

I should also note that when we pass the URL to google docs it seems to work, so I'm wondering if I'm passing the url incorrectly to view.offficeapps.live.com?

Does anyone know where we are going wrong?

Any help would be very much appreciated.

Regards

Adrian

Microsoft 365 and Office | Word | For business | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2022-05-10T19:13:09+00:00

    Hi Adrian_J_T:

    It seems that your issue is related to iframe. I'm sorry I didn't find anything about why this token is invalid.

    To avoid sharing any incorrect information from our side, it’s also recommended to ask the question  in the Welcome to the Developer group. (microsoft.com) for a better help. Since your issue is relate to Program development, it is better suited to post in that community. And it has more experts in this area to help you.

    Thank you for your understanding. Our forums mainly discuss functional application aspects rather than development aspects.

    If I have any misunderstands, welcome to contact me. And I will further investigate it.

    Best Regards,

    Tin

    Was this answer helpful?

    0 comments No comments