Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
fco271292 opened this issue Dec 10, 2020 · 6 comments

Comments

@fco271292
Copy link

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.

@dspies
Copy link

dspies commented Jan 5, 2021

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.

@fco271292
Copy link
Author

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

@matthijsbierman
Copy link

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 grails/grails-spring-security-core#724.

Fixed in Grails 5.1.4 and later.

@tucker-bluesage
Copy link

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
Copy link

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.

@jdaugherty
Copy link
Contributor

It does look like grails.plugin.springsecurity.rest.token.storage.jwt.secret is working in the 6.1.1 changes in PR #521 I'm going to close this, but will happily reopen if a problem is found after that PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants