简体   繁体   中英

how to use IS_AUTHENTICATED_FULLY IN grails 3 spring-security

i'm setting up a new project in grails 3 with spring-security and want to authenticate controller using IS_AUTHENTICATED_FULLY.

i've already tried adding url to requestmap according to official documents

@Secured(['IS_AUTHENTICATED_FULLY'])

i expect the output to redirect to login controller if not login

I do this under the application.yml file grails-app/conf directory

grails.plugin.springsecurity.interceptUrlMap

https://grails-plugins.github.io/grails-spring-security-core/3.2.x/index.html#configGroovyMap

grails:
   plugin:
      springsecurity:
         interceptUrlMap:
            - pattern: '/**' #This can be any URL you want to customize
               access:
                  - 'IS_AUTHENTICATED_FULLY'

Do not copy paste that. Yaml is very picky with whitespace. Use tabs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM