{"id":34088,"date":"2023-02-22T12:42:26","date_gmt":"2023-02-22T07:12:26","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=34088"},"modified":"2023-02-24T12:43:04","modified_gmt":"2023-02-24T07:13:04","slug":"authorize-multiple-resources-while-working-with-oauth2-request","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2023\/02\/authorize-multiple-resources-while-working-with-oauth2-request\/","title":{"rendered":"Authorize multiple resources while working with OAuth2 request"},"content":{"rendered":"<p>Recently, I had a requirement where I had to grant access to a user to use SharePoint as well as CRM using Azure App. While working on this, I came across an OAuth2 request that would allow us to get access tokens &amp; refresh tokens using the scope of required resources (here, CRM &amp; SharePoint).<\/p>\n<p>Since multiple scopes were being accepted, I went ahead and passed scopes of CRM SharePoint in the same request. The request was similar to the below &#8211;<\/p>\n<pre class=\"lang:css gutter:true start:1\">var b2cAuthUri = \"<a href=\"https:\/\/login.microsoftonline.com\/\" target=\"_blank\" rel=\"noopener\">https:\/\/login.microsoftonline.com\/<\/a>\" + tenantId + \"\/oauth2\/v2.0\/authorize?\"+\r\n\r\n\"client_id=\" + clientId +\r\n\r\n\"&amp;response_type=code\" +\r\n\r\n\"&amp;redirect_uri=\" + redirectUrl +\r\n\r\n\"&amp;scope=offline_access\"+\" \"+crmURL + \"\/user_impersonation\" +\" \"+ sharepointSite +\r\n\r\n\"\/User.read.all Sites.FullControl.All \" + \"\";<\/pre>\n<p>After the above request, I continued to perform operations according to the requirement. When I used the generated access token to perform CRM-related functionality it worked as expected. However, when I used the same access token to upload a file in SharePoint, it threw a <span style=\"color: #ff0000;\"><strong>401 UNAUTHORIZED ERROR<\/strong><\/span>.<\/p>\n<p>Then after some digging, I found out that there is a restriction from the OAuth2 endpoint as it is designed to provide a token for the resource specified in the first scope listed in the request. This means that if a request is made with multiple scopes specified, only the first scope will be considered for token generation. As a result, any additional scopes listed in the request will not affect the token generation process.<\/p>\n<p>So, due to the restriction from OAuth2, I created a new request consisting of a single resource with a particular scope and generated the tokens using that request which worked as expected.<\/p>\n<h2><strong>Conclusion <\/strong><\/h2>\n<p>In the future, if you want to use multiple scopes and multiple resources, for each resource, a distinct request should be made that includes the request for that specific resource and its corresponding scope. By doing this, the requests can be tailored to meet the unique requirements of each resource and scope, providing greater control and flexibility in the request process.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/product\/productivity-apps\/auto-manage-lead-assignment-and-distribution-automation-dynamics-365-crm\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" class=\"alignnone wp-image-34090\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2023\/02\/Assign-and-Distribute-Leads.png\" alt=\"Assign and Distribute Leads\" width=\"1044\" height=\"261\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2023\/02\/Assign-and-Distribute-Leads.png 800w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2023\/02\/Assign-and-Distribute-Leads-300x75.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2023\/02\/Assign-and-Distribute-Leads-768x192.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2023\/02\/Assign-and-Distribute-Leads-660x165.png 660w\" sizes=\"(max-width: 1044px) 100vw, 1044px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently, I had a requirement where I had to grant access to a user to use SharePoint as well as CRM using Azure App. While working on this, I came across an OAuth2 request that would allow us to get access tokens &amp; refresh tokens using the scope of required resources (here, CRM &amp; SharePoint).\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2023\/02\/authorize-multiple-resources-while-working-with-oauth2-request\/\">Read More: Authorize multiple resources while working with OAuth2 request &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[2675],"class_list":["post-34088","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-oauth2"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.8 - aioseo.com -->\n\t<meta name=\"description\" content=\"Recently, I had a requirement where I had to grant access to a user to use SharePoint as well as CRM using Azure App. While working on this, I came across an OAuth2 request that would allow us to get access tokens &amp; refresh tokens using the scope of required resources (here, CRM &amp; SharePoint).\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Inogic\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.inogic.com\/blog\/2023\/02\/authorize-multiple-resources-while-working-with-oauth2-request\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.8\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Microsoft Dynamics 365 CRM Tips and Tricks - By Inogic\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Authorize multiple resources while working with OAuth2 request - Microsoft Dynamics 365 CRM Tips and Tricks\" \/>\n\t\t<meta property=\"og:description\" content=\"Recently, I had a requirement where I had to grant access to a user to use SharePoint as well as CRM using Azure App. While working on this, I came across an OAuth2 request that would allow us to get access tokens &amp; refresh tokens using the scope of required resources (here, CRM &amp; SharePoint).\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.inogic.com\/blog\/2023\/02\/authorize-multiple-resources-while-working-with-oauth2-request\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2023\/02\/Assign-and-Distribute-Leads.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2023\/02\/Assign-and-Distribute-Leads.png\" \/>\n\t\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t\t<meta property=\"og:image:height\" content=\"200\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2023-02-22T07:12:26+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2023-02-24T07:13:04+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inogicindia\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@inogic\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Authorize multiple resources while working with OAuth2 request - Microsoft Dynamics 365 CRM Tips and Tricks\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Recently, I had a requirement where I had to grant access to a user to use SharePoint as well as CRM using Azure App. While working on this, I came across an OAuth2 request that would allow us to get access tokens &amp; refresh tokens using the scope of required resources (here, CRM &amp; SharePoint).\" \/>\n\t\t<meta name=\"twitter:creator\" content=\"@inogic\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2023\/02\/Assign-and-Distribute-Leads.png\" \/>\n\t\t<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t\t<meta name=\"twitter:data1\" content=\"Inogic\" \/>\n\t\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2023\\\/02\\\/authorize-multiple-resources-while-working-with-oauth2-request\\\/#blogposting\",\"name\":\"Authorize multiple resources while working with OAuth2 request - Microsoft Dynamics 365 CRM Tips and Tricks\",\"headline\":\"Authorize multiple resources while working with OAuth2 request\",\"author\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/author\\\/inogic-2\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/02\\\/Assign-and-Distribute-Leads.png\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2023\\\/02\\\/authorize-multiple-resources-while-working-with-oauth2-request\\\/#articleImage\",\"width\":800,\"height\":200,\"caption\":\"Assign and Distribute Leads\"},\"datePublished\":\"2023-02-22T12:42:26+05:30\",\"dateModified\":\"2023-02-24T12:43:04+05:30\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2023\\\/02\\\/authorize-multiple-resources-while-working-with-oauth2-request\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2023\\\/02\\\/authorize-multiple-resources-while-working-with-oauth2-request\\\/#webpage\"},\"articleSection\":\"Uncategorized, OAuth2\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2023\\\/02\\\/authorize-multiple-resources-while-working-with-oauth2-request\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.inogic.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/uncategorized\\\/#listItem\",\"name\":\"Uncategorized\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/uncategorized\\\/#listItem\",\"position\":2,\"name\":\"Uncategorized\",\"item\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/uncategorized\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2023\\\/02\\\/authorize-multiple-resources-while-working-with-oauth2-request\\\/#listItem\",\"name\":\"Authorize multiple resources while working with OAuth2 request\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2023\\\/02\\\/authorize-multiple-resources-while-working-with-oauth2-request\\\/#listItem\",\"position\":3,\"name\":\"Authorize multiple resources while working with OAuth2 request\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/uncategorized\\\/#listItem\",\"name\":\"Uncategorized\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/#organization\",\"name\":\"Microsoft Dynamics 365 CRM Tips and Tricks\",\"description\":\"By Inogic\",\"url\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/02\\\/inogic-logo.png\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2023\\\/02\\\/authorize-multiple-resources-while-working-with-oauth2-request\\\/#organizationLogo\",\"width\":1000,\"height\":325,\"caption\":\"inogic logo\"},\"image\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2023\\\/02\\\/authorize-multiple-resources-while-working-with-oauth2-request\\\/#organizationLogo\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/inogicindia\",\"https:\\\/\\\/twitter.com\\\/inogic\",\"https:\\\/\\\/www.instagram.com\\\/inogicindia\\\/\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCM4V7ousgLSu1hbOEv4DUuQ\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/inogicindia\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/author\\\/inogic-2\\\/#author\",\"url\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/author\\\/inogic-2\\\/\",\"name\":\"Inogic\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2023\\\/02\\\/authorize-multiple-resources-while-working-with-oauth2-request\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/839d9ae7d2b941d2d09e91df322267a429821f2ce5494302b53bd5ca3679f1a0?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Inogic\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2023\\\/02\\\/authorize-multiple-resources-while-working-with-oauth2-request\\\/#webpage\",\"url\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2023\\\/02\\\/authorize-multiple-resources-while-working-with-oauth2-request\\\/\",\"name\":\"Authorize multiple resources while working with OAuth2 request - Microsoft Dynamics 365 CRM Tips and Tricks\",\"description\":\"Recently, I had a requirement where I had to grant access to a user to use SharePoint as well as CRM using Azure App. While working on this, I came across an OAuth2 request that would allow us to get access tokens & refresh tokens using the scope of required resources (here, CRM & SharePoint).\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2023\\\/02\\\/authorize-multiple-resources-while-working-with-oauth2-request\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/author\\\/inogic-2\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/author\\\/inogic-2\\\/#author\"},\"datePublished\":\"2023-02-22T12:42:26+05:30\",\"dateModified\":\"2023-02-24T12:43:04+05:30\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/\",\"name\":\"Microsoft Dynamics 365 CRM Tips and Tricks\",\"alternateName\":\"Inogic\",\"description\":\"By Inogic\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Authorize multiple resources while working with OAuth2 request - Microsoft Dynamics 365 CRM Tips and Tricks","description":"Recently, I had a requirement where I had to grant access to a user to use SharePoint as well as CRM using Azure App. While working on this, I came across an OAuth2 request that would allow us to get access tokens & refresh tokens using the scope of required resources (here, CRM & SharePoint).","canonical_url":"https:\/\/www.inogic.com\/blog\/2023\/02\/authorize-multiple-resources-while-working-with-oauth2-request\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/www.inogic.com\/blog\/2023\/02\/authorize-multiple-resources-while-working-with-oauth2-request\/#blogposting","name":"Authorize multiple resources while working with OAuth2 request - Microsoft Dynamics 365 CRM Tips and Tricks","headline":"Authorize multiple resources while working with OAuth2 request","author":{"@id":"https:\/\/www.inogic.com\/blog\/author\/inogic-2\/#author"},"publisher":{"@id":"https:\/\/www.inogic.com\/blog\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2023\/02\/Assign-and-Distribute-Leads.png","@id":"https:\/\/www.inogic.com\/blog\/2023\/02\/authorize-multiple-resources-while-working-with-oauth2-request\/#articleImage","width":800,"height":200,"caption":"Assign and Distribute Leads"},"datePublished":"2023-02-22T12:42:26+05:30","dateModified":"2023-02-24T12:43:04+05:30","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.inogic.com\/blog\/2023\/02\/authorize-multiple-resources-while-working-with-oauth2-request\/#webpage"},"isPartOf":{"@id":"https:\/\/www.inogic.com\/blog\/2023\/02\/authorize-multiple-resources-while-working-with-oauth2-request\/#webpage"},"articleSection":"Uncategorized, OAuth2"},{"@type":"BreadcrumbList","@id":"https:\/\/www.inogic.com\/blog\/2023\/02\/authorize-multiple-resources-while-working-with-oauth2-request\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.inogic.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/category\/uncategorized\/#listItem","name":"Uncategorized"}},{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/category\/uncategorized\/#listItem","position":2,"name":"Uncategorized","item":"https:\/\/www.inogic.com\/blog\/category\/uncategorized\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/2023\/02\/authorize-multiple-resources-while-working-with-oauth2-request\/#listItem","name":"Authorize multiple resources while working with OAuth2 request"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/2023\/02\/authorize-multiple-resources-while-working-with-oauth2-request\/#listItem","position":3,"name":"Authorize multiple resources while working with OAuth2 request","previousItem":{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/category\/uncategorized\/#listItem","name":"Uncategorized"}}]},{"@type":"Organization","@id":"https:\/\/www.inogic.com\/blog\/#organization","name":"Microsoft Dynamics 365 CRM Tips and Tricks","description":"By Inogic","url":"https:\/\/www.inogic.com\/blog\/","logo":{"@type":"ImageObject","url":"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2023\/02\/inogic-logo.png","@id":"https:\/\/www.inogic.com\/blog\/2023\/02\/authorize-multiple-resources-while-working-with-oauth2-request\/#organizationLogo","width":1000,"height":325,"caption":"inogic logo"},"image":{"@id":"https:\/\/www.inogic.com\/blog\/2023\/02\/authorize-multiple-resources-while-working-with-oauth2-request\/#organizationLogo"},"sameAs":["https:\/\/www.facebook.com\/inogicindia","https:\/\/twitter.com\/inogic","https:\/\/www.instagram.com\/inogicindia\/","https:\/\/www.youtube.com\/channel\/UCM4V7ousgLSu1hbOEv4DUuQ","https:\/\/www.linkedin.com\/company\/inogicindia"]},{"@type":"Person","@id":"https:\/\/www.inogic.com\/blog\/author\/inogic-2\/#author","url":"https:\/\/www.inogic.com\/blog\/author\/inogic-2\/","name":"Inogic","image":{"@type":"ImageObject","@id":"https:\/\/www.inogic.com\/blog\/2023\/02\/authorize-multiple-resources-while-working-with-oauth2-request\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/839d9ae7d2b941d2d09e91df322267a429821f2ce5494302b53bd5ca3679f1a0?s=96&d=mm&r=g","width":96,"height":96,"caption":"Inogic"}},{"@type":"WebPage","@id":"https:\/\/www.inogic.com\/blog\/2023\/02\/authorize-multiple-resources-while-working-with-oauth2-request\/#webpage","url":"https:\/\/www.inogic.com\/blog\/2023\/02\/authorize-multiple-resources-while-working-with-oauth2-request\/","name":"Authorize multiple resources while working with OAuth2 request - Microsoft Dynamics 365 CRM Tips and Tricks","description":"Recently, I had a requirement where I had to grant access to a user to use SharePoint as well as CRM using Azure App. While working on this, I came across an OAuth2 request that would allow us to get access tokens & refresh tokens using the scope of required resources (here, CRM & SharePoint).","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.inogic.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.inogic.com\/blog\/2023\/02\/authorize-multiple-resources-while-working-with-oauth2-request\/#breadcrumblist"},"author":{"@id":"https:\/\/www.inogic.com\/blog\/author\/inogic-2\/#author"},"creator":{"@id":"https:\/\/www.inogic.com\/blog\/author\/inogic-2\/#author"},"datePublished":"2023-02-22T12:42:26+05:30","dateModified":"2023-02-24T12:43:04+05:30"},{"@type":"WebSite","@id":"https:\/\/www.inogic.com\/blog\/#website","url":"https:\/\/www.inogic.com\/blog\/","name":"Microsoft Dynamics 365 CRM Tips and Tricks","alternateName":"Inogic","description":"By Inogic","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.inogic.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"Microsoft Dynamics 365 CRM Tips and Tricks - By Inogic","og:type":"article","og:title":"Authorize multiple resources while working with OAuth2 request - Microsoft Dynamics 365 CRM Tips and Tricks","og:description":"Recently, I had a requirement where I had to grant access to a user to use SharePoint as well as CRM using Azure App. While working on this, I came across an OAuth2 request that would allow us to get access tokens &amp; refresh tokens using the scope of required resources (here, CRM &amp; SharePoint).","og:url":"https:\/\/www.inogic.com\/blog\/2023\/02\/authorize-multiple-resources-while-working-with-oauth2-request\/","og:image":"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2023\/02\/Assign-and-Distribute-Leads.png","og:image:secure_url":"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2023\/02\/Assign-and-Distribute-Leads.png","og:image:width":800,"og:image:height":200,"article:published_time":"2023-02-22T07:12:26+00:00","article:modified_time":"2023-02-24T07:13:04+00:00","article:publisher":"https:\/\/www.facebook.com\/inogicindia","twitter:card":"summary_large_image","twitter:site":"@inogic","twitter:title":"Authorize multiple resources while working with OAuth2 request - Microsoft Dynamics 365 CRM Tips and Tricks","twitter:description":"Recently, I had a requirement where I had to grant access to a user to use SharePoint as well as CRM using Azure App. While working on this, I came across an OAuth2 request that would allow us to get access tokens &amp; refresh tokens using the scope of required resources (here, CRM &amp; SharePoint).","twitter:creator":"@inogic","twitter:image":"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2023\/02\/Assign-and-Distribute-Leads.png","twitter:label1":"Written by","twitter:data1":"Inogic","twitter:label2":"Est. reading time","twitter:data2":"2 minutes"},"aioseo_meta_data":{"post_id":"34088","title":null,"description":null,"keywords":[],"keyphrases":{"focus":{"keyphrase":"","score":0,"analysis":{"keyphraseInTitle":{"score":0,"maxScore":9,"error":1}}},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":[],"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"BlogPosting","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2023-02-24 07:08:15","updated":"2025-07-04 09:57:49","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.inogic.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.inogic.com\/blog\/category\/uncategorized\/\" title=\"Uncategorized\">Uncategorized<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tAuthorize multiple resources while working with OAuth2 request\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.inogic.com\/blog"},{"label":"Uncategorized","link":"https:\/\/www.inogic.com\/blog\/category\/uncategorized\/"},{"label":"Authorize multiple resources while working with OAuth2 request","link":"https:\/\/www.inogic.com\/blog\/2023\/02\/authorize-multiple-resources-while-working-with-oauth2-request\/"}],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/34088","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/comments?post=34088"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/34088\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=34088"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=34088"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=34088"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}