Yvand / EntraCP

EntraCP (formerly AzureCP) is a claims provider that connects SharePoint to your Microsoft Entra ID tenant, in federated authentication
https://entracp.yvand.net/
Apache License 2.0
38 stars 8 forks source link

AzureCP with multiple SPTrustedIdentityTokenIssuers #101

Closed mhintner closed 4 years ago

mhintner commented 4 years ago

Hi Yvan, I'm trying to make AzureCP runnable with multiple SPTrustedIdentityTokenIssuers. There are multiple WebApps, each with an associated AzureAD Tenant. I changed you code a bit so that the appropriate provider is selected at runtime. image Everything works fine as long as I'm using the Root SC of every WebApp only. As soon as I want to open settings.aspx in another SC, an unexpected error occurs. Do you have any idea? Thanks in advance, Markus

Yvand commented 4 years ago

Hi @mhintner, my current state of knowledge is that you cannot use the same claims provider (class) with multiple SPTrustedIdentityTokenIssuers because at runtime there is no way to determine what TrustedLoginProvider is currently calling. Did you find a way to deal with that, but you're stuck on a different problem, or is it not working because of that?

mhintner commented 4 years ago

Hi Yvan, I use the description of SPTrustedIdentityTokenIssuer to store the url of the RootSC and at runtime I try to find the correct one based on the current URL. This works fine for the RootSC in different WebApps but doesn't work for path based SCs below (at least not for SiteSettings, regular pages are ok). The error when opening the SiteSettings of a path based SC is "File not found". Kind regards, Markus

Yvand commented 4 years ago

When you say that non-root path-based SPSite don't work in site settings, what exactly is not working?

mhintner commented 4 years ago

The error when opening the SiteSettings of a path based SC is "File not found".

Yvand commented 4 years ago

So you simply navigate to the site settings and you get an error "File not found"? I don't see how this error can be possibly related to the custom claims provider. What makes you think so?

mhintner commented 4 years ago

Yes, that's the effect. It is reproducible in two environments, as soon as the ClaimsProvider is removed, everything works fine.

Yvand commented 4 years ago

Do you have any technical details about what happens when you browse to that page? Is AzureCP class called?

mhintner commented 4 years ago

Yes AzureCP is called, but the following exception occurs: Getting Error Message for Exception System.ArgumentNullException: Value cannot be null.
at Microsoft.SharePoint.SPSite.OpenWeb(String strUrl, Boolean requireExactUrl)
at Microsoft.SharePoint.SPSite.get_RootWeb()
at Microsoft.SharePoint.Navigation.SPNavigationProvider.GetChildNodes(SiteMapNode node)
at System.Web.UI.WebControls.SiteMapDataSource.GetTreeView(String viewPath)
at System.Web.UI.WebControls.HierarchicalDataBoundControl.GetData(String viewPath)
at System.Web.UI.WebControls.Menu.DataBindItem(MenuItem item)
at System.Web.UI.WebControls.Menu.PerformDataBinding()
at System.Web.UI.WebControls.HierarchicalDataBoundControl.PerformSelect()
at System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound()
at System.Web.UI.WebControls.Menu.EnsureDataBound()
at Microsoft.SharePoint.WebControls.AspMenu.OnPreRender(EventArgs e)
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Yvand commented 4 years ago

I don't have any possible explanation for this, AFAIK I never got that behavior

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.