grails-spring-security-rest
grails-spring-security-rest copied to clipboard
A JWT secret must be defined - grails.plugin.springsecurity.conf.rest.token.storage.jwt.secret
I use grails 4.0.4, spring-security-core:4.0.3 and spring-security-rest:3.0.0.RC1 in this case the version should be 3.0.1 but no run the app, in the application.groovy write the property grails.plugin.springsecurity.conf.rest.token.storage.jwt.secret = '' but no run, only show the message: Please provide a value for the config property: grails.plugin.springsecurity.conf.rest.token.storage.jwt.secret, how to solve this problem?, Thanks in advance.
I believe it is a typo in the documentation. The following configuration property worked for me:
grails.plugin.springsecurity.rest.token.storage.jwt.secret
It does not have the conf
and can also be specified in the application.yml
file as well.
I have tried with property grails.plugin.springsecurity.rest.token.storage.jwt.secret = "SECRET_KEY_OF_32_CHARACTERS_OWN"
in file application.yml
and application.groovy
obtaining successful result, also with the version grails 4.0.6
, spring-security-rest:3.0.1
and spring-security-core:4.0.3
, thanks @dspies
The same error occurred with Grails 5.1.3 and spring-security-core:5.0.0
in spring-security-rest:3.0.1
.
Caused by https://github.com/grails/grails-spring-security-core/issues/724.
Fixed in Grails 5.1.4 and later.
I'm seeing the same error in Grails 5.1.7 and 5.1.8, tried setting the property in application.yml. runtime.groovy and as a -D command line parameter, but nothing seems to work..
I also tried setting it as an environment variable. I did however find that I could set it in application.groovy, as long as there was no DSL stuff in it. I think that the other config methods(ENV variable, property, runtime.groovy) should be supported, and that they don't for this is a bug or at the very least should be considered for future enhancement.
It does look like grails.plugin.springsecurity.rest.token.storage.jwt.secret
is working in the 6.1.1 changes in PR https://github.com/grails/grails-spring-security-rest/pull/521 I'm going to close this, but will happily reopen if a problem is found after that PR.