Skip to content

SPFx in Teams Desktop app returns 403 Unable to retrieve Client Secret #7780

Closed
@rvhelden

Description

@rvhelden

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

SharePoint REST API

Developer environment

Windows

What browser(s) / client(s) have you tested

  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)

Additional environment details

  • SPFX 1.13.1

The teams tab loads the iframe to the sharepoint online environment with the following url
_layouts/15/TeamsLogon.aspx?SPFX=true&dest=https://.sharepoint.com/_layouts/15/teamshostedapp.aspx%3Fteams%26personal%26componentId=%26forceLocale=en-us

Describe the bug / error

When executing a graph call in spfx in this specific sharepoint tenant via the teams desktop app, this will fail with a call to /sites/Branding-home/_api/Microsoft.SharePoint.Internal.ClientSideComponent.Token.AcquireOBOToken?resource=%27https://graph.microsoft.com%27&clientId=%27<principal_id of SPO EC>%27

It receives a 403 status with the following body

{
   "odata.error":{
      "code":"-2147024891, System.UnauthorizedAccessException",
      "message":{
         "lang":"nl-NL",
         "value":"Unable to retrieve Client Secret"
      }
   }
}

Steps to reproduce

  1. Open Teams app
  2. Navigate to tab pointing to sharepoint online environment
  3. All calls to graph fail

Expected behavior

To authenticate correctly

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Author FeedbackAwaiting response from the original poster of the issue. Marked as stale if no activity for 7 days.area:spfxCategory: SharePoint Framework (not extensions related)no-recent-activityStale issue due to lack of activity. Closed after 7 days with no activity by OP.type:bug-suspectedSuspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions