Closed ppazos closed 6 years ago
Tr to call clearCachedRequestMaps
() after saving the request maps
springSecurityService.clearCachedRequestmaps()
Check http://grails-plugins.github.io/grails-spring-security-core/v3/index.html#requestmap-cache
If it does not help, please provide a sample project in github.
Yes! that broke the too many redirects. Maybe this should be added to the docs:
Bootstrap:
for (String url in [
'/', '/error', '/index', '/index.gsp', '/**/favicon.ico', '/shutdown',
'/**/js/**', '/**/css/**', '/**/images/**',
'/login', '/login.*', '/login/*',
'/logout', '/logout.*', '/logout/*']) {
new RequestMap(url: url, configAttribute: 'permitAll').save(failOnError:true)
}
springSecurityService.clearCachedRequestmaps()
I also needed to add this to access the dbconsole
new RequestMap(url: '/dbconsole/**', configAttribute: 'ROLE_ADMIN').save(failOnError:true)
Thanks!
@sdelamo please consider to update the status of this issue.
The solution you proposed should be included on the docs. Should I create another issue for that?
Thanks @ppazos I will updated the docs in the next release. Don't need to create a new issue.
I've been using the sec plugin for grails 2.x projects without problem, now trying to do a new project on Grails 3 I'm blocked on Sec config and not sure if this is a bug.
Here describes a similar problem, seems to be an issue with the hibernate plugin: http://stackoverflow.com/questions/28628398/redirect-loop-with-requestmap-with-grails-spring-security-core-2-0rc4
My case:
Created a new app, added compile 'org.grails.plugins:spring-security-core:3.1.2' at the end of my dependencies, and did:
Then grails run-app.
Trying to access the /dbconsole, redirects to /login/auth /login/auth got "localhost redirected you too many times." ERR_TOO_MANY_REDIRECTS
Added this on bootstrap, no change to the redirect problem:
application.groovy generated from the quickstart script:
build.gradle