Closed ppazos closed 8 years ago
Nevermind, just saw the other param "extraData", but userName seems to be required, is that correct?
Correct, userName is required (but it is a simple String, you can pass anything, even the uuid) and on "extraData" you can add any additional data that you need.
+1
Right now, JwtStatelessTokenProvider.generateToken only accepts a username. Since some might not use the username to identify users, or might not use a username for authentication at all, it would be good to provide a token generation method that allows other kinds of data in the JWT payload. E.g. in my apps I use a UUID to identify users, not the username.
ref: https://github.com/kaleidos/grails-security-stateless/blob/c86758c70515cdebf23500bac3e39607e7e7eae5/src/groovy/net/kaleidos/grails/plugin/security/stateless/token/JwtStatelessTokenProvider.groovy#L29