Spring Secutiry (ACEGI) Plugin and Favicon Permissions
September 6, 2010
Here’s a quick gotcha for you. You set up a favicon in the root of your web app, as is the convention, and when you log in you are redirected to a picture of your favicon or you are asked to download it… Weird.
Odds on you’ve installed the Spring Security plugin and forgotten to give permission to the favicon file in the root and the result is that on login Spring Security redirects you to the first restricted item that was requested by the browser – the favicon.
The solution? Easy, set the favicon path to IS_AUTHENTICATED_ANONYMOUSLY in your SecurityConfig.groovy (or database):
controllerAnnotationStaticRules = [
...
'/favicon.ico' : ['IS_AUTHENTICATED_ANONYMOUSLY'],
...
]
September 19, 2010 at 10:20 pm
Awesome man – had this problem and hardly had to research thanks to your post
THANKS!
September 20, 2010 at 8:16 am
Thanks Jeremy, I’m glad it helped you out!