Closed GoogleCodeExporter closed 9 years ago
Sounds like upon hitting the AJAX action, the CAS filter thinks the user needs
to be
authenticated and redirects them to the CAS server. This doesn't really work
for AJAX
requests though, since the response can't come from a remote server (in this
case the
CAS server).
The easiest solution might be to disable the CAS filter for your AJAX actions;
something like:
---
before_filter CASClient::Frameworks::Rails::Filter, :except => [:ajax_action,
:another_ajax_action]
---
But this might not be desirable if your AJAX actions return data that should
require
authentication.
I suspect that maybe you configured your Rails filter in such a way that it gets
executed on every request. This is almost certainly not what you want.
Instead, try doing something like this:
---
before_filter :authenticate_with_cas
protected
def authenticate_with_cas(controller)
if controller.session[:cas_user]
return true
else
return CASClient::Frameworks::Rails::Filter.filter
end
end
---
I'm thinking that maybe the above should be the filter's default behaviour,
since
this problem seems to come up a lot for end-users like yourself.
Original comment by matt.zuk...@gmail.com
on 27 Feb 2008 at 7:56
FYI this has been fixed and will be released in 2.0.1. If you're using the Rails
plugin and have it installed via Subversion, you can just do an update now and
the
behaviour you're looking for will be restored.
Original comment by matt.zuk...@gmail.com
on 27 Feb 2008 at 11:18
Original issue reported on code.google.com by
erikord...@gmail.com
on 27 Feb 2008 at 5:59