Forum Discussion
How to add SharePoint Pages in a static tab with authentication?
Like YannickReekmans said: the other articles are relevant only when developing your own application/page but don't really help when using a SharePoint page.
That being said, I bumped into the same issue and got it to work.
The biggest part of the solution came from Wajeed in the following StackOverflow thread:
However, since he reffered to 'microsoft.sharepoint.com' and 'teams' path in the url's he provided, I got confused and failed at first.
Then I found the following article which helped me get all the variables correct:
TL/DR;
Add/Edit the following snippet into your manifest file:
"staticTabs": [ { "entityId": "TestTabId", "name": "Test Tab", "contentUrl": "https://{tenantname}.sharepoint.com/sites/{site}/_layouts/15/teamslogon.aspx?spfx=true&dest=/sites/{site}/SitePages/{page}.aspx", "scopes": ["personal"], "websiteUrl": "https://fullwebsite.website.com/about" } ], "validDomains": [ "*.login.microsoftonline.com", "{tenantname}.sharepoint.com", "{tenantname}.sharepoint-df.com", "spoppe-a.akamaihd.net", "spoprod-a.akamaihd.net", "resourceseng.blob.core.windows.net", "msft.spoppe.com" ], "webApplicationInfo": { "resource": "https://{tenantname}.sharepoint.com", "id": "00000003-0000-0ff1-ce00-000000000000" }
where:
- {tenantname} should be replaced with the name of your tenant
- {site} should be the url portion reffering to the correct site collection
- {page} should be the url portion reffering to the sharepoint page you would like to load
Hope it helps!
With kind regards,
Stijn Brouwers
- Sep 19, 2019
Stijn Brouwers I knew about this workaround at the time I replied, but was asked (by Microsoft) not to share it. At the time, I flagged this thread with them to let them know it is a valid use case.
This was shared with MVP's for internal testing, as this was not considered stable nor supported. Haven't heard that this has changed. Wajeed-MSFT is from MS, so I guess we can use it now...
Maybe Jethro Seghers / Jethro SEGHERS can share more?
- Sep 19, 2019
FYI, I checked with the responsible person inside MS and this is currently not supported. As long as it is not in docs, it's not supported. It works in some/most cases apparently but more work needs to happen to make it stable, and be a better experience overall.
- Stijn BrouwersSep 19, 2019Copper Contributor
- chengjieMar 04, 2021Copper Contributor
YannickReekmans Hi, I have the similar problem to authenticate a user when opening a SharePoint Page in a static tab. In my specific scenario, I trying to build a multi-tenant app that can lead user to the SharePoint Page of their tenant, that means user from different tenant will be led to different SharePoint Page of their own tenant.
There is a SSO solution for authentication in one SharePoint Page, but it won't work in my case, because the URL of the SharePoint Page might differ from different tenant users.
Do you have any idea to solve this problem?
- Mar 04, 2021@chengji If you check the example manifest on the page you link to, they use the {teamSiteDomain} and {teamSitePath} tokens. While the docs aren't clear about this, you can leave them as is in your manifest and they will be translated automatically when your app is run in Teams.
By using these tokens you can make your app multi tenant.