Access Denied

Jan 31, 2011 at 1:48 PM
Edited Feb 4, 2011 at 9:50 AM

Hello

I'm trying to use the remote page provider but have run into several problems. Some of the configuration issues have I manage to solve. But now I seems to have something right because the client site to tries to talk to the server site.

The error  I got is this: System.ServiceModel.FaultException`1[[EPiServer.Labs.RemoteProvider.RemoteProviderFault, RemoteProvider, Version=1.0.0.1, Culture=neutral, PublicKeyToken=null]]: Access denied

In the documentation of the page provider there are lots of attributes not explained how to use or with any sample. It would be much simplier if there where a complete working configuraton both for the client site and for the server site.

Another question besides the access denied problem is how to configure the remoteVirtualPath in the pageProvider section. And does the configuration for the VirtualPath have something to do with the pageProvider configuration? Are they related in some way?

I have configured the sites as bellow.

Best regards

Peter

 

Server site configuration:

<service name="EPiServer.Labs.RemoteProvider.RemoteProviderServer" behaviorConfiguration="RemoteProviderServiceBehavior">
 <endpoint name="RemotePageProviderService" bindingConfiguration="RemoteProviderBindingConfig" contract="EPiServer.Labs.RemoteProvider.IRemoteProvider"
    binding="wsHttpBinding" address=""/>
 <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration="" contract="IMetadataExchange" />
 <host>
  <baseAddresses>
   <add baseAddress="http://localhost:17002/Services/RemotePageProviderService.svc"/>
  </baseAddresses>
 </host>
</service>

<wsHttpBinding>
 <binding name="RemoteProviderBindingConfig" >
  <security>
   <message clientCredentialType="Windows" negotiateServiceCredential="true" />
  </security>
 </binding>
</wsHttpBinding>

<behavior name="RemoteProviderServiceBehavior">
 <serviceMetadata httpGetEnabled="true" httpGetBinding="" />
 <serviceDebug includeExceptionDetailInFaults="true" />
</behavior>

<wsHttpBinding>
 <binding name="RPPBinding">
  <security mode="Message">
   <message negotiateServiceCredential="true" clientCredentialType="Windows"/>
  </security>
 </binding>
</wsHttpBinding>

Client site configuration:

<client>
 <endpoint name="RPP_EndPoint" address="http://localhost:17002/Services/RemotePageProviderService.svc" bindingConfiguration="RPPBinding" binding="wsHttpBinding"
   contract="EPiServer.Labs.RemoteProvider.IRemoteProvider">
 </endpoint>
</client>

<wsHttpBinding>
 <binding name="RPPBinding">
  <security mode="Message">
   <message negotiateServiceCredential="true" clientCredentialType="Windows"/>
  </security>
 </binding>
</wsHttpBinding>

 

<pageProvider>
 <providers>
  <add name="RemoteProviderService" type="EPiServer.Labs.RemoteProvider.RemotePageProvider, RemoteProvider"
   endpointName="RPP_EndPoint" entryPoint="26" remoteEntryPoint="117" userName="RemotePP" password="xxxx"
  showContentOfWasteBasket="false" remoteVirtualPath="~/PageFiles" />
 </providers>
</pageProvider>

<virtualPath customFileSummary="~/FileSummary.config">
 <providers>
  <clear />
  ....
  <add name="RemoteVPP" type="EPiServer.Labs.RemoteProvider.RemoteVirtualPathProvider, RemoteProvider" userName="RemotePP" password="xxxx"
     virtualName ="RemotePageFiles" virtualPath="~/PageFiles" endpointName="RPP_EndPoint" />
 </providers>
</virtualPath>


Coordinator
Feb 3, 2011 at 7:22 AM

It looks you have gotten AccessDenied from application layer which means you are not allow to call on the server ( CheckServiceAccess). If it so you need get the user correct permission on the server.
instruction to give the user permission to call webserver call. 
Brows to Admin->Config->Security->Permissions for Dunctions->Allow the user to act as a web service user.

If it is not so it means you have problem in the communication service layer (WCF configuration). in this case there are two attribute (proxyUserName and proxyPassword) which they are the WCF channel credintials username and password.

And answer to RemoteVirtualPathprovider issuse, the only you need to configure is on the remote page provider you need specify the remoteVirtualPath attribute and it's value should be the virtualpath of the remote virtual path provider.

 

Feb 4, 2011 at 9:48 AM
Edited Feb 4, 2011 at 9:59 AM

Hi Shahram

Thank you. It helped to get rid of the access denied error.

But now I got another exception that I can't understand what's wrong. I have tried to change the configuration a bit but without success.

The error I got is the error bellow. It seems that the remote provider have tried to get pages from the server, but got nothing. And the the client tries to store the pages.

Do you think I'm on the right track? I have updated the configuration in the first post with user name etc so that You can see the current config.

Regards

Peter

Server Error in '/' Application.
--------------------------------------------------------------------------------

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   EPiServer.Core.CreatePageData.AddBasePageData(PageReference pageLink, PageData pageData, PageType pageType, PageReference parentPageLink) +706
   EPiServer.Core.PageProviderBase.InitializePageData(PageData page, String pageName, String pageTypeName, Guid pageGuid, PageReference pageLink, PageReference pageParentLink, IList`1 existingLanguages, String languageBranchId) +282
   EPiServer.Core.PageProviderBase.InitializePageData(PageData page, String pageName, String pageTypeName, Guid pageGuid, PageReference pageLink, PageReference pageParentLink, IList`1 existingLanguages) +97
   EPiServer.Labs.RemoteProvider.RemotePageProvider.CreatePageData(RemotePageRaw remotePageData, Boolean readOnly) +914
   EPiServer.Labs.RemoteProvider.RemotePageProvider.GetLocalPage(PageReference pageLink, ILanguageSelector selector) +243
   EPiServer.Core.<>c__DisplayClass4.<GetPageInternal>b__3() +148
   EPiServer.Core.OptimisticCache`1.Read(String cacheKey, ReadAndCacheObject`1 readAndCacheObject) +1673
   EPiServer.Core.PageProviderBase.GetPageInternal(PageReference pageLink, ILanguageSelector selector) +895
   EPiServer.Core.PageProviderBase.GetPage(PageReference pageLink, ILanguageSelector selector) +48
   EPiServer.Core.PageProviderBase.GetPages(PageReferenceCollection pageReferences, ILanguageSelector selector) +150
   EPiServer.Core.PageProviderBase.GetScatteredPages(PageReferenceCollection pageRefs, ILanguageSelector selector) +397
   EPiServer.Core.PageProviderBase.GetChildren(PageReference pageLink, ILanguageSelector selector, Int32 startIndex, Int32 maxRows) +138
   EPiServer.DataFactory.GetChildren(PageReference pageLink, ILanguageSelector selector, Int32 startIndex, Int32 maxRows) +697
   EPiServer.DataFactory.GetChildren(PageReference pageLink, ILanguageSelector selector) +23
   EPiServer.Web.WebControls.PageDataSource.GetChildrenForLoader(PageReference pageLink) +76
   EPiServer.Web.WebControls.HierarchicalPageLoader.GetFilteredChildren(PageReference pageLink) +47
   EPiServer.Web.WebControls.PageHierarchyData.EnsureChildrenLoaded() +127
   EPiServer.Web.WebControls.PageHierarchyData.get_HasChildren() +49
   EPiServer.UI.WebControls.PageTreeView.PopulateChildNodes(IHierarchicalEnumerable enumerable, Int32 depth, Int32 expandDepth, PageTreeNode parentNode, ArrayList populationPath) +704
   EPiServer.UI.WebControls.PageTreeView.PopulateChildNodes(IHierarchicalEnumerable enumerable, Int32 depth, Int32 expandDepth, PageTreeNode parentNode, ArrayList populationPath) +1008
   EPiServer.UI.WebControls.PageTreeView.PopulateChildNodes(IHierarchicalEnumerable enumerable, Int32 depth, Int32 expandDepth, PageTreeNode parentNode, ArrayList populationPath) +1008
   EPiServer.UI.WebControls.PageTreeView.PopulateRecursive(String viewPath) +266
   EPiServer.UI.WebControls.PageTreeView.PerformDataBinding() +154
   System.Web.UI.WebControls.HierarchicalDataBoundControl.PerformSelect() +114
   EPiServer.UI.Edit.PageExplorer.OnLoad(EventArgs e) +623
   System.Web.UI.Control.LoadRecursive() +66
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428

 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.4952; ASP.NET Version:2.0.50727.4955

Feb 8, 2011 at 9:09 AM

 

Hi again

When I’m debugging the client site I can see that the exception occurs when trying to call base.InitializePageData in the CreatePageData method in the RemotePageProvider class.

        private PageData CreatePageData(RemotePageRaw remotePageData, bool readOnly)
        {

            PageData pageData = new PageData(new PageAccessControlList(), new PropertyDataCollection());

            PageReference pageLink;
            string pageTypeName = string.Empty;
            PageReference pageParentLink = PageReference.EmptyReference;

            GetPageInfo(remotePageData, out pageLink, out pageParentLink, out pageTypeName);
            if (pageParentLink == PageReference.EmptyReference)
            {
                throw new PageNotFoundException(new PageReference(pageLink.ID, ProviderKey));
            }

            base.InitializePageData(pageData, "", pageTypeName, Guid.Empty, pageLink, pageParentLink, remotePageData.Languages);

It's the pageData.Category that is throwing a NullReferenceException. The other parameters; pageTypename, pageLink and parrentPagelink seems correct. The pageData properties PageLink, LinkURL and many other properties are empty or missing information (I have an image from a watch window but I can’t paste it in the reply).

Could it be because the Remote Page Provider doesn't support EPiServer CMS 6 or is it another access problem?

Best regards

Peter