1

I have set login endpointUrl in config.groovy as

grails.plugin.springsecurity.rest.login.endpointUrl = "/api/login"

How to access this endpointUrl values in your controller ?

tim_yates
  • 167,322
  • 27
  • 342
  • 338
Kamaldeep Singh
  • 765
  • 2
  • 8
  • 28

2 Answers2

1

In a controller you can use:

Holders.config.grails.plugin.springsecurity.rest.login.endpointUrl

Or:

grailsApplication.config.grails.plugin.springsecurity.rest.login.endpointUrl

See: This answer

Cookalino
  • 1,559
  • 14
  • 19
0

Personally, I'm not a big fan of Holders because it makes your code a bit harder to test. Instead, I prefer to inject config to avoid having a dependency on the Holders class: @Value('${grails.plugin.springsecurity.rest.login.endpointUrl}') def endpointUrl