<html><head></head><body bgcolor="#FFFFFF"><div>Have you checked for the anti cross site request forgery header in the ajax request? </div><div>Rails won't accept post requests without that by default<br><br></div><div>Il giorno 30/mag/2012, alle ore 21:39, Rick Wayne <<a href="mailto:fewayne@wisc.edu">fewayne@wisc.edu</a>> ha scritto:<br><br></div><div></div><blockquote type="cite"><div>Hey all,<div><br></div><div>Pardon if this is a FAQ, but I've been hunting around for an answer and am still baffled.</div><div><br></div><div>I have a Ruby on Rails 3.0 application which happily uses the ruby-openid gem to perform delegated authentication. Works great.</div><div><br></div><div>However, some of the views in the application use JQuery, specifically JQGrid data-driven elements. And when the user does certain things, the grid obligingly fires off a POST back to the server.</div><div><br></div><div>Which does a redirect to the OpenID provider, as if this user had not already authenticated and gotten a session running. ???</div><div><br></div><div>Furthermore, the redirect just dies at that point, the Javascript doing the post never follows the redirect and so the POST never gets to my server. It looks as if it just gives up when the auth code in my app returns the 401 that's supposed to kick off the OpenID dance.</div><div><br></div><div>Now, perhaps the easy answer is "Well, it's JQuery's problem, mate". But I can't believe that I'm the first person to ever try this kind of thing, which makes me think that it's not <i>JQuery's </i>problem so much as <i>my</i> problem, that I've missed something blindingly obvious (like unknowingly running afoul of cross-site scripting defenses).</div><div><br></div><div>If y'all could point me to the path of righteousness, that would delight the people funding my project no end. And thus, indirectly, my wife, who (trust me on this) is a very good person to keep happy.</div><div><br></div><div>TIA,</div><div><br></div><div><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div>rw</div><div><br></div><div>UW Soil Science</div></span>
</div>
<br></div></div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Code mailing list</span><br><span><a href="mailto:Code@lists.openid.net">Code@lists.openid.net</a></span><br><span><a href="http://lists.openid.net/mailman/listinfo/openid-code">http://lists.openid.net/mailman/listinfo/openid-code</a></span><br></div></blockquote></body></html>