{"id":20898,"date":"2024-05-16T12:00:10","date_gmt":"2024-05-16T19:00:10","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/?p=20898"},"modified":"2024-05-16T09:24:29","modified_gmt":"2024-05-16T16:24:29","slug":"device-permission-prompt-api-available-for-office-add-ins","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/device-permission-prompt-api-available-for-office-add-ins\/","title":{"rendered":"Device Permission Prompt API available for Office Add-ins on the web"},"content":{"rendered":"<p>Microsoft now requires Office Add-in developers to prompt users for permission to access their device capabilities. This applies to add-ins that run on the following Office applications.<\/p>\n<ul>\n<li>Web versions of Microsoft Word, Excel, Outlook, and PowerPoint running in Chromium-based browsers (such as Microsoft Edge or Google Chrome)<\/li>\n<li><a class=\"fui-Link ___1rxvrpe f2hkw1w f3rmtva f1ewtqcl fyind8e f1k6fduh f1w7gpdv fk6fouc fjoy568 figsok6 f1hu3pq6 f11qmguv f19f4twv f1tyq0we f1g0x7ka fhxju0i f1qch9an f1cnd47f fqv5qza f1vmzxwi f1o700av f13mvf36 f1cmlufx f9n3di6 f1ids18y f1tx3yz7 f1deo86v f1eh06m1 f1iescvh fhgqx19 f1olyrje f1p93eir f1nev41a f1h8hb77 f1lqvz6u f10aw75t fsle3fq f17ae5zn\" title=\"https:\/\/support.microsoft.com\/office\/656bb8d9-5a60-49b2-a98b-ba7822bc7627\" href=\"https:\/\/support.microsoft.com\/office\/656bb8d9-5a60-49b2-a98b-ba7822bc7627\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"Link New Outlook for Windows\">New Outlook for Windows<\/a><\/li>\n<\/ul>\n<p>A user\u2019s device capabilities include their camera, geolocation, and microphone. To prompt your users for permissions, you can now implement the\u00a0<a class=\"fui-Link ___1rxvrpe f2hkw1w f3rmtva f1ewtqcl fyind8e f1k6fduh f1w7gpdv fk6fouc fjoy568 figsok6 f1hu3pq6 f11qmguv f19f4twv f1tyq0we f1g0x7ka fhxju0i f1qch9an f1cnd47f fqv5qza f1vmzxwi f1o700av f13mvf36 f1cmlufx f9n3di6 f1ids18y f1tx3yz7 f1deo86v f1eh06m1 f1iescvh fhgqx19 f1olyrje f1p93eir f1nev41a f1h8hb77 f1lqvz6u f10aw75t fsle3fq f17ae5zn\" title=\"https:\/\/aka.ms\/devicepermissionapi\" href=\"https:\/\/aka.ms\/DevicePermissionAPI\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"Link Device Permission API\">Device Permission API<\/a>\u00a0in your add-in.\u00a0\u00a0This change doesn\u2019t impact add-ins that run in Office on Windows, on Mac, or other browsers like Safari.<\/p>\n<p><span data-contrast=\"auto\">If your organization has an existing add-in or is building one that requires access to a user\u2019s device capabilities and will run in Office on the web on Chromium-based browsers, your developers must implement the Device Permission API. This API shows a dialog to the user that contains the following:<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">The name of the add-in requesting permission.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/li>\n<\/ul>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"2\" data-aria-level=\"1\"><span data-contrast=\"auto\">The device capabilities the add-in needs to use.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/li>\n<\/ul>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"3\" data-aria-level=\"1\"><span data-contrast=\"auto\">The options for the user to <\/span><b><span data-contrast=\"auto\">Allow<\/span><\/b><span data-contrast=\"auto\">, <\/span><b><span data-contrast=\"auto\">Allow once<\/span><\/b><span data-contrast=\"auto\">, or <\/span><b><span data-contrast=\"auto\">Deny<\/span><\/b><span data-contrast=\"auto\"> permission to the add-in.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><span data-contrast=\"auto\">When a user selects <\/span><b><span data-contrast=\"auto\">Allow <\/span><\/b><span data-contrast=\"auto\">or<\/span><b><span data-contrast=\"auto\"> Deny<\/span><\/b><span data-contrast=\"auto\">, their permission is stored in the cache. This prevents the same add-in from prompting the user for the same permission. To change an add-in\u2019s permission to a user\u2019s device capabilities, the user must uninstall, then reinstall the add-in. Alternatively, they can also clear their browser cache.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2024\/05\/device_permission.png\"><img decoding=\"async\" class=\"size-full wp-image-21168 alignnone\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2024\/05\/device_permission.png\" alt=\"Image device permission\" width=\"1062\" height=\"320\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2024\/05\/device_permission.png 1062w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2024\/05\/device_permission-300x90.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2024\/05\/device_permission-1024x309.png 1024w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2024\/05\/device_permission-768x231.png 768w\" sizes=\"(max-width: 1062px) 100vw, 1062px\" \/><\/a><\/p>\n<p><span data-contrast=\"auto\">In Outlook add-ins that implement event-based activation, browser permissions aren\u2019t inherited. Additionally, the Device Permission API isn\u2019t supported or recommended in these add-ins.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">To learn more about how the user is prompted for permission to their device capabilities, see <\/span><a href=\"https:\/\/support.microsoft.com\/office\/16278816-1948-4028-91e5-76dca5380f8d\"><span data-contrast=\"none\">View, manage, and install add-ins for Excel, PowerPoint, and Word<\/span><\/a><span data-contrast=\"auto\">.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Thank you for your continued support of Office Add-ins on all platforms.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<h2>Additional resources<\/h2>\n<p><a href=\"https:\/\/developer.microsoft.com\/office\"><span data-contrast=\"none\">Office Dev Center<\/span><\/a><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><a href=\"https:\/\/learn.microsoft.com\/office\/dev\/add-ins\/concepts\/privacy-and-security\"><span data-contrast=\"none\">Privacy and security in Office Add-ins<\/span><\/a><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Microsoft now requires Office Add-in developers to prompt users for permission to access their device capabilities. To do this, you can now implement the Device Permission API.<\/p>\n","protected":false},"author":157677,"featured_media":20923,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1,11],"tags":[313],"class_list":["post-20898","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-microsoft-365-developer","category-office-add-ins","tag-permissions"],"acf":[],"blog_post_summary":"<p>Microsoft now requires Office Add-in developers to prompt users for permission to access their device capabilities. To do this, you can now implement the Device Permission API.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/20898","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\/157677"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/comments?post=20898"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/20898\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/media\/20923"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/media?parent=20898"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/categories?post=20898"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/tags?post=20898"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}