Teams app to open SharePoint homepage, problems loading

Brass Contributor

I am trying to upgrade an old Teams app used on the left rail that opens the homepage of a SharePoint site. I got an app more or less working in https://dev.teams.microsoft.com/apps, however, while continuing to work on it, the app now does not load. The issue may have to do with authentication and the choice of urls. I attach the manifest file.

 

The key issues may be in the webApplicationInfo, where I copied the resource from the AAD registration for the app, and in the contentURL, which I copied from a prior working app. I think some small modification of this manifest will work, but I cannot get the right combination. Thanks.

 

 

 

{
  "manifestVersion": "1.11", 
  "name": {
    "short": "GradEvol", 
    "full": ""
  }, 
  "icons": {
    "color": "color.png", 
    "outline": "outline.png"
  }, 
  "packageName": "com.package.name", 
  "description": {
    "short": "Show homepage for Puzzles class", 
    "full": "Show homepage for Puzzles class"
  }, 
  "webApplicationInfo": {
    "resource": "api://[AAD CLIENT APP ID]",  # OBTAINED FROM AAD REGISTRATION
    "id": "[AAD CLIENT APP ID]"
  }, 
  "accentColor": "#ffffff", 
  "version": "1.0.4", 
  "validDomains": [
    "mydomain.sharepoint.com", 
    "resourceseng.blob.core.windows.net", 
    "*.sharepoint-df.com", 
    "teams.microsoft.com", 
    "*.login.microsoftonline.com", 
    "*.mysite.org"
  ], 
  "$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.11/MicrosoftTeams.schema.json", 
  "devicePermissions": [
    "openExternal"
  ], 
  "staticTabs": [
    {
      "contentUrl": "https://mydomain.sharepoint.com/sites/gradevol22/_layouts/15/teamslogon.aspx?SPFX=true&dest=/sites/gradevol22", 
      "websiteUrl": "https://mydomain.sharepoint.com/sites/gradevol22", 
      "entityId": "1bb75087-4a4f-4aae-988c-87cff583e574", 
      "name": "GradEvol", 
      "scopes": [
        "personal"
      ]
    }, 
    {
      "scopes": [
        "personal"
      ], 
      "entityId": "about"
    }
  ], 
  "id": "31aa7c4c-1a7f-47dc-b1bc-59a3fe9f8b26", 
  "developer": {
    "websiteUrl": "https://mysite.org", 
    "mpnId": "", 
    "termsOfUseUrl": "https://mysite.org/stevehome.html", 
    "name": "Steve", 
    "privacyUrl": "https://mysite.org/stevehome.html"
  }
}

 

 

3 Replies
Changing api://{client id} to api://mydomain.sharepoint.com/{client id} did not work. I see an "App resource defined in manifest and iframe origin do not match" error but not sure which app resource.
https://{domain}/{client id}
Answering my own question: do register app w/AAD, but do not create an Application ID URI. When creating the app with the Developer Portal, under Single Sign On, enter https://mydomain.sharepoint.com. In other words, let SharePoint do all authentication. It may work to use AAD api, but the SP approach seems to work well.