{"id":6990,"date":"2021-08-27T13:02:58","date_gmt":"2021-08-27T21:02:58","guid":{"rendered":"https:\/\/officedevblogs.wpengine.com\/?p=6633"},"modified":"2022-05-25T17:53:32","modified_gmt":"2022-05-26T00:53:32","slug":"action-required-update-your-office-add-in-dialog-for-cross-domain-communication","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/action-required-update-your-office-add-in-dialog-for-cross-domain-communication\/","title":{"rendered":"Update your Office Add-in Dialog for cross-domain calls"},"content":{"rendered":"<p>We&#8217;ve recently implemented a security update to the Office Add-in Dialog API. This affects cross-domain communication between the dialog and the parent page (typically a task pane) using either the <a href=\"https:\/\/docs.microsoft.com\/javascript\/api\/office\/office.ui#messageParent_message__messageOptions_\">Office.ui.messageParent<\/a> or <a href=\"https:\/\/docs.microsoft.com\/javascript\/api\/office\/office.dialog#messageChild_message__messageOptions_\">Office.dialog.messageChild<\/a> methods. Cross-domain communication means that your add-in calls one of these methods when the parent page and the dialog are in different domains.<\/p>\n<h2>Action required to update your Office Add-in Dialog<\/h2>\n<p>If you&#8217;re using either method to make cross-domain calls, <em>this is a breaking change. You must update your add-in<\/em>. You need to add a new parameter, <a href=\"https:\/\/docs.microsoft.com\/javascript\/api\/office\/office.dialogmessageoptions\">DialogMessageOptions<\/a>, to the call of <code>messageParent<\/code> or <code>messageChild<\/code>. The new parameter is an object with a <code>targetOrigin<\/code> property that specifies the URL of the domain for which the message is intended.<\/p>\n<p>For more information and sample code, see <a href=\"https:\/\/docs.microsoft.com\/office\/dev\/add-ins\/develop\/dialog-api-in-office-add-ins#cross-domain-messaging-to-the-host-runtime\">Cross-domain messaging to the host runtime<\/a> \u00a0and <a href=\"https:\/\/docs.microsoft.com\/office\/dev\/add-ins\/develop\/dialog-api-in-office-add-ins#cross-domain-messaging-to-the-dialog-runtime\">Cross-domain messaging to the dialog runtime<\/a>.<\/p>\n<p>Same domain communication will remain unaffected. A call to <code>messageParent<\/code> or <code>messageChild<\/code> does not need the new parameter when the dialog and parent are in the same domain. So, you don\u2019t need to do anything if your add-in only makes same domain calls.<\/p>\n<p>This change does not affect the Office add-in single sign-on API (<a href=\"https:\/\/docs.microsoft.com\/javascript\/api\/office\/office.auth\">Office.auth.getAccessToken<\/a>).<\/p>\n<p>As part of this change, we&#8217;ve introduced a new requirement set, <a href=\"https:\/\/docs.microsoft.com\/office\/dev\/add-ins\/reference\/requirement-sets\/dialog-origin-requirement-sets\">DialogOrigin 1.1<\/a>, which contains the new versions of <code>messageParent<\/code> and <code>messageChild<\/code>.<\/p>\n<p>On Windows, users can set a registry key to bypass the target origin validation if needed. For instructions, see the Tip in <a href=\"https:\/\/docs.microsoft.com\/office\/dev\/add-ins\/develop\/dialog-api-in-office-add-ins#cross-domain-messaging-to-the-host-runtime\">Cross-domain messaging to the host runtime<\/a>. Then, cross-domain communication will continue to run even if you do not update them to use the new parameter. You should have users do this only as a temporary expediency until the add-in is updated.<\/p>\n<h3>Call to Action<\/h3>\n<p>If your add-in makes cross-domain calls of <code>messageParent<\/code> or <code>messageChild<\/code>:<\/p>\n<ul>\n<li><em>As soon as possible, <\/em>update your add-in to pass the new parameter.<\/li>\n<\/ul>\n<h3>Changes are rolling out with the following builds<\/h3>\n<ul>\n<li>Office on the web: Live from 7\/19\/2021<\/li>\n<li>Microsoft 365 on Windows subscription: 16.0.14310.10000<\/li>\n<li>Office on Mac: 16.52.21080801<\/li>\n<li>Office on iOS: 2.52.21080801<\/li>\n<li>Semi-annual channel: The September Patch Tuesday (9\/14\/2021) will include the update.<\/li>\n<\/ul>\n<p>To stay up-to-date, we encourage you to follow the <a href=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/category\/office-add-ins\/\">Office Add-ins developer blog<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We have recently implemented a security update to the Office add-in Dialog API that affects cross-domain communication between the dialog and the parent page.<\/p>\n","protected":false},"author":69724,"featured_media":25159,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[11],"tags":[28],"class_list":["post-6990","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-office-add-ins","tag-office-add-ins"],"acf":[],"blog_post_summary":"<p>We have recently implemented a security update to the Office add-in Dialog API that affects cross-domain communication between the dialog and the parent page.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/6990","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/users\/69724"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/comments?post=6990"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/6990\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/media\/25159"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/media?parent=6990"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/categories?post=6990"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/tags?post=6990"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}