Grails, SpringSecurity - disable redirection if not registered

How do I configure grails to not redirect the user / user to the login page if it tries to access a protected resource. I just want to send a 401 status error to redirect to the main page.


source to share

1 answer

What you want to do is set up authenticationEntryPoint, which can usually be done in spring / resources.groovy. If you are having difficulty finding the notation in the Spring Security Core plugin documentation, but there is a discussion about Jira tickets that links to it:

In one of our projects, we wanted to submit a 403 response, so we added this line to the .groovy resources:

AuthenticationEntryPoint (

Hope it helps.



All Articles