{"id":6065,"date":"2021-03-08T14:24:58","date_gmt":"2021-03-08T22:24:58","guid":{"rendered":"https:\/\/officedevblogs.wpengine.com\/?p=6065"},"modified":"2021-11-17T12:39:27","modified_gmt":"2021-11-17T20:39:27","slug":"microsoft-graph-toolkit-adds-a-new-electron-provider-plus-enhanced-capabilities","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/microsoft-graph-toolkit-adds-a-new-electron-provider-plus-enhanced-capabilities\/","title":{"rendered":"Microsoft Graph Toolkit\u00a0adds a new Electron Provider plus enhanced capabilities"},"content":{"rendered":"<p><span data-contrast=\"auto\">Today, we\u00a0released\u00a0<\/span><a href=\"https:\/\/github.com\/microsoftgraph\/microsoft-graph-toolkit\/releases\/tag\/v2.1.0\"><span data-contrast=\"none\">version 2.1 of the Microsoft Graph Toolkit<\/span><\/a><span data-contrast=\"auto\">. This release includes\u00a0a new authentication provider for Electron applications,\u00a0as well as improvements and bug fixes for the existing components and providers.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">As a recap, the\u202f<\/span><a href=\"https:\/\/docs.microsoft.com\/graph\/toolkit\/overview\"><span data-contrast=\"none\">Microsoft Graph Toolkit\u202f<\/span><\/a><span data-contrast=\"auto\">\u202fis a collection of components and providers that makes your integration with Microsoft Graph as easy as writing two lines of code. To learn more, read the\u00a0<a href=\"https:\/\/nam06.safelinks.protection.outlook.com\/?url=https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Ftoolkit%2Fproviders%2Felectron&amp;data=04%7C01%7Cv-dawik%40microsoft.com%7C7d8a24691bce42bfb15b08d8e25729d6%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637508211562869006%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=2PLZAat7%2FCwBL%2FdLB1ucLNg5mUO0Bp2NI6WJQ2UesfI%3D&amp;reserved=0\">documentation<\/a>,\u00a0try the\u00a0<a href=\"https:\/\/nam06.safelinks.protection.outlook.com\/?url=https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Ftoolkit%2Fget-started%2Fbuild-an-electron-app&amp;data=04%7C01%7Cv-dawik%40microsoft.com%7C7d8a24691bce42bfb15b08d8e25729d6%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637508211562869006%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=N8G2Yq%2Fy183nDk9UaBJwBm2BwHtxGC69D0QOgNHput8%3D&amp;reserved=0\">getting started tutorial<\/a>, or clone and run this\u00a0<a href=\"https:\/\/nam06.safelinks.protection.outlook.com\/?url=https%3A%2F%2Fgithub.com%2Fmicrosoftgraph%2Fmicrosoft-graph-toolkit%2Ftree%2Fmain%2Fsamples%2Felectron-app&amp;data=04%7C01%7Cv-dawik%40microsoft.com%7C7d8a24691bce42bfb15b08d8e25729d6%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637508211562878956%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=onxrwzBRBcg3u%2Fud6%2F7db8QTq7O%2BxzDGKvmZ1ufWJv8%3D&amp;reserved=0\">sample<\/a> to see it in action.<\/span><\/p>\n<h3>Updating your application<\/h3>\n<p><span data-contrast=\"auto\">To update your application to use the newest version of Microsoft Graph Toolkit,\u00a0go\u00a0to your project directory and run:<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<pre class=\"lang: decode:true \">npm\u00a0i\u00a0@microsoft\/mgt@latest<\/pre>\n<p><span data-contrast=\"auto\">If you\u2019re using the Toolkit via\u202fmgt-loader, your application will be automatically updated to the newest version.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<h3>What\u2019s New?<\/h3>\n<h4>Electron\u00a0provider<\/h4>\n<p><span data-contrast=\"auto\">The Microsoft Graph Toolkit authentication providers enable you to easily implement authentication with the Microsoft Identity Platform for your application.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">The new Electron provider\u00a0uses\u00a0msal-node to sign in\u00a0users\u00a0and acquire access tokens to request data from Microsoft Graph inside of an Electron application.\u00a0It\u00a0is available on all platforms where Electron applications can run.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">To use it, add it to your Electron app with:<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<pre class=\"lang: decode:true \">npm\u00a0install @microsoft\/mgt-element @microsoft\/mgt-electron-provider<\/pre>\n<p><span data-contrast=\"auto\">Create\u00a0the\u00a0ElectronProvider\u00a0in your renderer process:<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<pre class=\"lang: decode:true \">import {Providers} from '@microsoft\/mgt-element';\u00a0\n\nimport {ElectronProvider} from '@microsoft\/mgt-electron-provider\/dist\/Provider';\u00a0\n\nProviders.globalProvider\u00a0= new\u00a0ElectronProvider();<\/pre>\n<p><span data-contrast=\"auto\">And\u00a0initialize the\u00a0ElectronAuthenticator\u00a0in your main process:<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<pre class=\"lang: decode:true \">import {\u00a0ElectronAuthenticator\u00a0} from '@microsoft\/mgt-electron-provider\/dist\/Authenticator';\u00a0\u00a0\n\nElectronAuthenticator.initialize({\u00a0\n\n\u00a0\u00a0\u00a0\u00a0clientId: '&lt;your_client_id&gt;',\u00a0\n\n\u00a0\u00a0\u00a0\u00a0mainWindow:\u00a0mainWindow\u00a0\n\n\u00a0\u00a0};\u00a0\n\n);<\/pre>\n<p><span data-contrast=\"auto\">You can now call <a href=\"https:\/\/developer.microsoft.com\/en-us\/graph\/\">Microsoft Graph<\/a> and use any Microsoft Graph Toolkit components\u00a0as you normally would.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">To learn more, read the documentation, try the\u00a0<\/span><span data-contrast=\"auto\">getting started tutorial,<\/span><span data-contrast=\"auto\">\u00a0or clone and run\u00a0this\u00a0<\/span><a href=\"https:\/\/github.com\/microsoftgraph\/microsoft-graph-toolkit\/tree\/main\/samples\/electron-app\"><span data-contrast=\"none\">sample<\/span><\/a><span data-contrast=\"auto\">\u00a0to see it in action.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<h3>Other\u00a0improvements<\/h3>\n<p><span data-contrast=\"auto\">This release also includes\u00a0several\u00a0improvements and bug fixes to the existing components and providers, including:<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Added support for\u00a0HTML attributes and events, such as\u00a0<\/span><span data-contrast=\"auto\">className,id<\/span><span data-contrast=\"auto\">, and\u00a0<\/span><span data-contrast=\"auto\">onClick<\/span><span data-contrast=\"auto\">\u00a0in the\u00a0<\/span><a href=\"https:\/\/www.npmjs.com\/package\/@microsoft\/mgt-react\"><span data-contrast=\"none\">mgt-react package<\/span><\/a><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-aria-posinset=\"2\" data-aria-level=\"1\"><span data-contrast=\"auto\">Addition of the\u00a0<\/span><span data-contrast=\"auto\">disabled<\/span><span data-contrast=\"auto\">\u00a0attribute and property to the\u00a0<\/span><a href=\"https:\/\/docs.microsoft.com\/en-us\/graph\/toolkit\/components\/people-picker\"><span data-contrast=\"none\">People Picker<\/span><\/a><span data-contrast=\"auto\">\u00a0component\u00a0to allow read-only\u00a0functionality<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-aria-posinset=\"3\" data-aria-level=\"1\"><span data-contrast=\"auto\">Added support for searching across the \/users\u00a0endpoint in the\u00a0<\/span><a href=\"https:\/\/docs.microsoft.com\/en-us\/graph\/toolkit\/components\/person\"><span data-contrast=\"none\">Person component<\/span><\/a><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-aria-posinset=\"4\" data-aria-level=\"1\"><span data-contrast=\"auto\">Addition of line\u00a0click events to the\u00a0<\/span><a href=\"https:\/\/docs.microsoft.com\/en-us\/graph\/toolkit\/components\/person\"><span data-contrast=\"none\">Person Component<\/span><\/a><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-aria-posinset=\"5\" data-aria-level=\"1\"><span data-contrast=\"auto\">Addition of the\u00a0<\/span><span data-contrast=\"auto\">consistencylevel\u00a0<\/span><span data-contrast=\"auto\">header to the\u00a0<\/span><a href=\"https:\/\/docs.microsoft.com\/en-us\/graph\/toolkit\/providers\/proxy\"><span data-contrast=\"none\">Proxy Provider<\/span><\/a><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><span data-contrast=\"auto\">To see a full list of improvements and bug fixes, see\u00a0our\u00a0<\/span><a href=\"https:\/\/github.com\/microsoftgraph\/microsoft-graph-toolkit\/releases\/tag\/v2.1.0\"><span data-contrast=\"none\">release notes<\/span><\/a><span data-contrast=\"auto\">.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">We\u2019re looking forward to hearing your thoughts and feedback on this new release. Please submit any bugs, feature requests, and feedback by opening an issue in\u00a0our\u202f<\/span><a href=\"https:\/\/developer.microsoft.com\/en-us\/graph\/blogs\/announcing-the-general-availability-of-microsoft-graph-toolkit-2-0\/aka.ms\/mgt\"><span data-contrast=\"none\">Github repository<\/span><\/a><span data-contrast=\"auto\">.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">\u2013\u202fThe Microsoft Graph Toolkit team<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Microsoft Graph Toolkit v2.1, available today, has a new authentication provider for Electron applications plus other improvements to make for an easier Microsoft Graph integration.<\/p>\n","protected":false},"author":69077,"featured_media":25159,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[3],"tags":[34],"class_list":["post-6065","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-microsoft-graph","tag-microsoft-graph-toolkit"],"acf":[],"blog_post_summary":"<p>Microsoft Graph Toolkit v2.1, available today, has a new authentication provider for Electron applications plus other improvements to make for an easier Microsoft Graph integration.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/6065","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\/69077"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/comments?post=6065"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/6065\/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=6065"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/categories?post=6065"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/tags?post=6065"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}