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
Navita_007Navita_007 

iframe vf page for community guest profile

I want a vf page to show up on a custom lightning component on a community public page. It is embedded as an iframe and loads/works perfectly if I’m logged in but without login I am getting this error in console “Refused to display <apex page> in a frame because it set 'X-Frame-Options' to 'deny'.” I am not sure if this is a salesforce limitation or I am missing some settings. Clickjack settings for vf page is turned off and the community guest profile has access to this vf page.
 
Best Answer chosen by Navita_007
Navita_007Navita_007
I was able to solve it. URL in iframe should have the path for visualforce page with community domain and not the internal salesforce org domain.

All Answers

Navita_007Navita_007
I was able to solve it. URL in iframe should have the path for visualforce page with community domain and not the internal salesforce org domain.
This was selected as the best answer
Vivin MathewVivin Mathew
Hi Navita
I am having the same issue and tried to use the community domain but its not working? Did you do any other configuration?
Navita_007Navita_007
@Vivin - No, just changing the path fixed it for me. Is your page public? If not, is that page available to the community profile or guest profile? Do you see any error in browser?
Vivin MathewVivin Mathew
Hi Navita
Yes i see the same error - Refused to display <apex page> in a frame because it set 'X-Frame-Options' to 'deny'
This is a public page accessible to the guest user. i have added the VF page to the guest user profile and i also did set the Clickjack to No Protection and still it didnt work.
Navita_007Navita_007
I just used the community domain in iframe and it works. Example : https://community.xxx.com/<vfpagename>
If you have the same url then something else could be missing, can you share your code?