OAuth Error in Salesforce

I wrote an integration for Salesforce a while back that read some information from a RESTful web service and displayed it in a VisualForce Page embedded in a standard page layout on an SObject. The system let you authorise with OAuth by clicking a link which would redirect you to the specified authorisation page and after authorising correctly you would be redirected back to the correct record.

The system used to work perfectly but then suddenly stopped working. The only error was regarding null input to JSON but digging deeper showed that the authorisation was never completing. Further digging and logging on the console from the link showed an error:

Refused to display document because display forbidden by X-Frame-Options.

Some digging lead me to this StackOverflow post which lead me to update the link to have a target=”_top” attribute, and now it all works again! Basically the OAuth provider had updated their service to properly implement the protocol which leads to this error being thrown if we are about to perform some sort of XSS style action.

Hope anyone who stumbles across this finds it helpful! It caused me a few headaches so I thought I would share.

Force.com Developer Meeting 1 Report

This past Tuesday was the inaugural meeting of the North UK Force.com Developer Group and I wanted to take a few minutes to jot down some thoughts and follow up on it.

Firstly I wanted to say a massive thanks to all those who came along. We had around 23 people turn up in the end which was a fantastic turn out for the first meeting and gave a wide variety of viewpoints for discussions. I am looking forward to getting to learn from all these people and get to know them a bit better.

The main focus of the evening was around a group based discussion on “The Top 10 (ish) Things Every Force.com Developer Should Know”. For this, I started out giving some blurb and saying about experiences I had training people before we split into 3 groups and came up with our own lists of things that should be known and attempted to compile a top 10. These were then presented by each group to the rest of the group and discussed. We found that they had 5 items in common which (those with + next to in the pictures). I presented my top 10 I had thought of in preparing the evening and Carolina from FinancialForce.com gave us some interesting input on how she has found it best to structure triggers for data validation.

After some administrative discussion on when to meet and where to take the group a few of us decamped to the pub to continue getting to know each other.

Below are the images taken on the night, I am looking forward to the next meeting already!

DSC02216

DSC02217

DSC02218

DSC02219

DSC02220

DSC02221DSC02222

DSC02223

Photos also available here!