grails-spring-security-rest icon indicating copy to clipboard operation
grails-spring-security-rest copied to clipboard

A JWT secret must be defined - grails.plugin.springsecurity.conf.rest.token.storage.jwt.secret

Open fco271292 opened this issue 4 years ago • 5 comments

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.

fco271292 avatar Dec 10 '20 04:12 fco271292

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 confand can also be specified in the application.yml file as well.

dspies avatar Jan 05 '21 16:01 dspies

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

fco271292 avatar Feb 07 '21 18:02 fco271292

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.

matthijsbierman avatar May 05 '22 15:05 matthijsbierman

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..

tucker-bluesage avatar May 31 '22 22:05 tucker-bluesage

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.

tucker-bluesage avatar Jun 01 '22 14:06 tucker-bluesage

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.

jdaugherty avatar Sep 27 '24 15:09 jdaugherty