te')); return $arr; } /* 遍历用户所有主题 * @param $uid 用户ID * @param int $page 页数 * @param int $pagesize 每页记录条数 * @param bool $desc 排序方式 TRUE降序 FALSE升序 * @param string $key 返回的数组用那一列的值作为 key * @param array $col 查询哪些列 */ function thread_tid_find_by_uid($uid, $page = 1, $pagesize = 1000, $desc = TRUE, $key = 'tid', $col = array()) { if (empty($uid)) return array(); $orderby = TRUE == $desc ? -1 : 1; $arr = thread_tid__find($cond = array('uid' => $uid), array('tid' => $orderby), $page, $pagesize, $key, $col); return $arr; } // 遍历栏目下tid 支持数组 $fid = array(1,2,3) function thread_tid_find_by_fid($fid, $page = 1, $pagesize = 1000, $desc = TRUE) { if (empty($fid)) return array(); $orderby = TRUE == $desc ? -1 : 1; $arr = thread_tid__find($cond = array('fid' => $fid), array('tid' => $orderby), $page, $pagesize, 'tid', array('tid', 'verify_date')); return $arr; } function thread_tid_delete($tid) { if (empty($tid)) return FALSE; $r = thread_tid__delete(array('tid' => $tid)); return $r; } function thread_tid_count() { $n = thread_tid__count(); return $n; } // 统计用户主题数 大数量下严谨使用非主键统计 function thread_uid_count($uid) { $n = thread_tid__count(array('uid' => $uid)); return $n; } // 统计栏目主题数 大数量下严谨使用非主键统计 function thread_fid_count($fid) { $n = thread_tid__count(array('fid' => $fid)); return $n; } ?>javascript - Error: AADSTS500011: The resource principal named "URL" was not found in the tenant - Stack Overf
最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Error: AADSTS500011: The resource principal named "URL" was not found in the tenant - Stack Overf

programmeradmin4浏览0评论

I am trying to add an app to our SharePoint Online site using the template from and we get the error below when we deploy to SharePoint and add the app/Web part to a test SharePoint site. We are using TypeScript as the template uses.

Has anyone else encountered this issue or know where to look for the issue?

Found [object Object]Driver Display External Error: Error: AADSTS500011: The resource principal named was not found in the tenant named 7018324c-9efd-4880-809d-b2e6bb1606b6. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You might have sent your authentication request to the wrong tenant. Trace ID: 358b22eb-cd2c-4091-b592-5a57cbc21d00 Correlation ID: ec96d656-1a36-42e2-a2b9-3ff78efc1e2e Timestamp: 2019-10-01 16:26:06Z

We have added a call to our own client as shown below. We are not sure why the resource principal was not found. The Tenant ID's match and things seem to be set up properly for authentication.

HelloWorldWebPart.ts

...
   this.context.aadHttpClientFactory
      .getClient('')
      .then((client: AadHttpClient): void => {

        client
          .get('', AadHttpClient.configurations.v1)
          .then((response: HttpClientResponse): Promise < Order[] > => {
            this.domElement.innerHTML += 'Received a response from Driver Display External: ' + response;
            return response.json();
          })

          .catch(error => {

            this.domElement.innerHTML += 'Driver Display External Error:  ' + error;
            console.error(error);
          });
      });
...

package-solution.json

{
  "$schema": ".schema.json",
  "solution": {
    "name": "helloworld-webpart-client-side-solution",
    "id": "**ID**",
    "version": "4.1.0.0",
    "includeClientSideAssets": true,
    "isDomainIsolated": false,
    "webApiPermissionRequests": [
      {
        "resource": "DriverDisplayExternal",
       "scope": "User.Read.All"
      }
     ]
  },
  "paths": {
    "zippedPackage": "solution/helloworld-webpart.sppkg"
  }
}

Any help or direction to where the issue may be would be very appreciated. Thanks in advance!

I am trying to add an app to our SharePoint Online site using the template from https://learn.microsoft./en-us/sharepoint/dev/spfx/web-parts/get-started/build-a-hello-world-web-part and we get the error below when we deploy to SharePoint and add the app/Web part to a test SharePoint site. We are using TypeScript as the template uses.

Has anyone else encountered this issue or know where to look for the issue?

Found [object Object]Driver Display External Error: Error: AADSTS500011: The resource principal named https://driverdisplayexternal.azurewebsites was not found in the tenant named 7018324c-9efd-4880-809d-b2e6bb1606b6. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You might have sent your authentication request to the wrong tenant. Trace ID: 358b22eb-cd2c-4091-b592-5a57cbc21d00 Correlation ID: ec96d656-1a36-42e2-a2b9-3ff78efc1e2e Timestamp: 2019-10-01 16:26:06Z

We have added a call to our own client as shown below. We are not sure why the resource principal was not found. The Tenant ID's match and things seem to be set up properly for authentication.

HelloWorldWebPart.ts

...
   this.context.aadHttpClientFactory
      .getClient('https://driverdisplayexternal.azurewebsites')
      .then((client: AadHttpClient): void => {

        client
          .get('https://driverdisplayexternal.azurewebsites/api/values', AadHttpClient.configurations.v1)
          .then((response: HttpClientResponse): Promise < Order[] > => {
            this.domElement.innerHTML += 'Received a response from Driver Display External: ' + response;
            return response.json();
          })

          .catch(error => {

            this.domElement.innerHTML += 'Driver Display External Error:  ' + error;
            console.error(error);
          });
      });
...

package-solution.json

{
  "$schema": "https://developer.microsoft./json-schemas/spfx-build/package-solution.schema.json",
  "solution": {
    "name": "helloworld-webpart-client-side-solution",
    "id": "**ID**",
    "version": "4.1.0.0",
    "includeClientSideAssets": true,
    "isDomainIsolated": false,
    "webApiPermissionRequests": [
      {
        "resource": "DriverDisplayExternal",
       "scope": "User.Read.All"
      }
     ]
  },
  "paths": {
    "zippedPackage": "solution/helloworld-webpart.sppkg"
  }
}

Any help or direction to where the issue may be would be very appreciated. Thanks in advance!

Share Improve this question asked Oct 1, 2019 at 21:58 DanDan 3331 gold badge3 silver badges15 bronze badges 6
  • If you want to call the service protected by Azure AD, the resource url must be Azure AD application's app id url. For more details, please refer to stackoverflow./questions/36059051/… – Jim Xu Commented Oct 2, 2019 at 1:52
  • @JimXu I tried this and it unfortunately didn't work. Thank you for the suggestion. – Dan Commented Oct 2, 2019 at 16:25
  • Could you tell me if you can call the api from other tools such as postman? – Jim Xu Commented Oct 7, 2019 at 1:01
  • Yes we can with postman. My co worker created a new application with a different way of getting what we need but we still haven't resolved this issue unfortunately. – Dan Commented Oct 7, 2019 at 13:17
  • Is that you protect your api by Azure AD? If so, could you tell me if the tenant of AD application you use to protect API and the SharePoint's tenant is the same? – Jim Xu Commented Oct 8, 2019 at 6:47
 |  Show 1 more ment

5 Answers 5

Reset to default 2

Never used this API, but if I had to guess you need to change the value here:

      .getClient('https://driverdisplayexternal.azurewebsites')

You can use either the client id / application id, or the application ID URI.

Sometimes this problem can occurr when you set a wrong name for the scope you are requesting access for or another configuration parameter.

I suggest to check carefully the scopes name, or maybe directly use the "copy" button from the Azure portal.

In my case it was a simple typo on a scope name.

Not sure if you figured the answer or not. When you used SPFx to request your own custom web api end point. there are couple steps:

  • request the permission so that you can go to SPO admin to approve the permission you request. for this case, the webApiPermissionRequests->resources needs to your AAD Application's Service Principal DisplayName. once you had AAD App create, you can run Get-AzureADServicePrincipal to get all your ServicePrincipal.
  • once you request the permission, from your code, you need to call AadHttpClient.getClient() to get aadHttpClient object based on the api resourceEndpoint you want, for this case, you need to pass your web api's Application ID URI which can be found from your AAD App's manifest->"identifierUris". General speaking, this should be something like api://[clientid] format. but you can change it to any unique value. I hope it helps.

In my case i had to use the App Id when i was consuming a multi tenant API.

In my case, TenantId and ClientId were both ok.

They can be found in AAD. TenantId is right there on landing page:

and then on the same page click Applications then tab All Applications find your application there should be ClientId check if they match.

If that is still not enough, click on the application and find roles

For me, it was roles that were missing after adding those wheels started rolling again:

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论