php - CSRF Setting issues when creating Facebook Canvas App for a Codeiginter Page -


i've codeigniter app, works fine. created facebook canvas app, , tried loading page generated codeigniter. didn't work. , got see dreaded - "the action have requested not allowed". ensure facebook app settings right, tried page site, , worked.

so started search possible problems, figure out because of csrf protection=true in cornfig settings. turned off csrf protection see, if work. then, worked , load codeigniter generated pages through facebook canvas app (sandbox mode, though..)

some suggested if hard code hidden field csrf token, (instead of depending on form_open() function) avoid rule, , logic, if had page, has no form @ all, should work fine. , couldn't not load pages don't have form.

and i'm not using ajax anywhere.

i'm using ci 2.1.3.

one related link - http://ellislab.com/forums/viewthread/228160/#1038448 though there many similar questions on stackoverflow , other forums, couldn't find satisfactory answer.

if see apache logs, don't feel turning off csrf protection idea.

so how make codeignter generated pages appear in facebook canvas app, without turning off csrf protection?

any pointers useful. time.

the root cause of problem how facebook call app page iframe. facebook send post default parameter (signed_request) in $_post array. when codeigniter checks csrf protection no csrf token found in post array.

so apparently there no straight forward solution this. can change conditions in csrf_verify function in system\core\security.php not verify when there value of $_post['signed_request'], know not idea.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -