function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
cmf919cmf919 

Authentication error on Force.com site pop-up

I've created a vf page for a Force.com site that includes a link.  When the link is clicked, javascript opens another vf page passing in a parameter.  The first page works great, but when the link is clicked I receive the dreaded Authentication Error screen.   All of my permissions are set on the site for the vf pages and objects and fields.   Using the debug log to monitor the guest user shows me a log when the 1st page is opened but no log is created when the link is clicked (and the javascript runs).  Does anyone have any ideas?

Best Answer chosen by Admin (Salesforce Developers) 
cmfreecmfree

Thanks Bob that is a great post for future reference.  We were able to solve our problem by changing how we open the 2nd vf page.

Our original vf page which caused the error contained this:

 

function openCasePopup(selectedCase) {
         var url = "/apex/PRsiteCaseDetail?id=" + selectedCase;
         newWin = window.open(url, 'Popup','height=400,width=600,left=100,top=100,resizable=yes,scrollbars=yes,toolbar=no,status=no');
         if (window.focus)
         {  newWin.focus(); }
         return false;
     }    

 

<a href="#" onclick="openCasePopup('{!cList.kase.id}'); return false">{!cList.kase.CaseNumber}</a>

 

Our new page which works did away with the javascript function and looks like this:

 

<apex:outputLink value="/apex/PRsiteCaseDetail?id={!cList.kase.id}" onclick="window.open(this.href,'{cList.kase.id}','height=500,width=600,left=100,top=100, resizable=yes,scrollbars=yes,toolbar=no,status=no'); return false">{!cList.kase.CaseNumber}</apex:outputLink>

 

 

 

 

All Answers

bob_buzzardbob_buzzard

Do any of the techniques on this blog post (not mine) help?

 

http://www.tgerm.com/2010/10/debugging-sites-authorization-required.html

cmfreecmfree

Thanks Bob that is a great post for future reference.  We were able to solve our problem by changing how we open the 2nd vf page.

Our original vf page which caused the error contained this:

 

function openCasePopup(selectedCase) {
         var url = "/apex/PRsiteCaseDetail?id=" + selectedCase;
         newWin = window.open(url, 'Popup','height=400,width=600,left=100,top=100,resizable=yes,scrollbars=yes,toolbar=no,status=no');
         if (window.focus)
         {  newWin.focus(); }
         return false;
     }    

 

<a href="#" onclick="openCasePopup('{!cList.kase.id}'); return false">{!cList.kase.CaseNumber}</a>

 

Our new page which works did away with the javascript function and looks like this:

 

<apex:outputLink value="/apex/PRsiteCaseDetail?id={!cList.kase.id}" onclick="window.open(this.href,'{cList.kase.id}','height=500,width=600,left=100,top=100, resizable=yes,scrollbars=yes,toolbar=no,status=no'); return false">{!cList.kase.CaseNumber}</apex:outputLink>

 

 

 

 

This was selected as the best answer
cmf919cmf919

Problem Solved!  Thanks.