CAS Client Plugin Doesn't Respect error.gsp

View: New views
3 Messages — Rating Filter:   Alert me  

CAS Client Plugin Doesn't Respect error.gsp

by oakridge :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Right now I am using the cas client plugin, but when a ticket is expired I get a stacktrace printed to the client.  All my other pages redirect to error.gsp.  Is there a way to make the plugin do the same?  I tried mapping "edu.yale.its.tp.cas.client.CASAuthenticationException" in my web.xml, but have had little luck:

        <error-page>
                <exception-type>edu.yale.its.tp.cas.client.CASAuthenticationException</exception-type>
                <location>/WEB-INF/grails-app/views/error.gsp</location>
        </error-page>

The above returns a blank screen, which isn't what error.gsp contains.

Thanks

Solution [Re: CAS Client Plugin Doesn't Respect error.gsp]

by oakridge :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I added the following to UrlMappings.groovy and it works now:

"500"(view:"error.gsp")

A Side note: it would be nice if one could declare URLs that the cas-client plugin shouldn't restrict.  I say this because I have a lot less URLs that need to be publicly accessible versus ones that need to be locked down.

**Scratch the last complaint, I fixed it with this:

cas.urlPattern = '/secure/*' in Config.groovy

- and -

static mappings = {
        "/secure/$controller/$action?/$id?"()
}
in UrlMappings.groovy

Man, I love Grails!

Thanks this plugin is easy and well done.

Re: Solution [Re: CAS Client Plugin Doesn't Respect error.gsp]

by Chen Wang :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Re error.gsp, good point I will look into that to see if it could be done nicely as you suggested.
The 'cas.urlPattern' is defined and used by the underlying cas java client and the plugin doesn't do any heavy-lifting to match more advanced needs. Your solution is excellent and would you mind I post that to the cas client plugin page so that other people can share your experience?

Chen

oakridge wrote:
I added the following to UrlMappings.groovy and it works now:

"500"(view:"error.gsp")

A Side note: it would be nice if one could declare URLs that the cas-client plugin shouldn't restrict.  I say this because I have a lot less URLs that need to be publicly accessible versus ones that need to be locked down.

**Scratch the last complaint, I fixed it with this:

cas.urlPattern = '/secure/*' in Config.groovy

- and -

static mappings = {
        "/secure/$controller/$action?/$id?"()
}
in UrlMappings.groovy

Man, I love Grails!

Thanks this plugin is easy and well done.