How can I retrieve grails springsecurity rest jwt token?

588 views Asked by At

I'm developing a Grails REST API to use with an Angular app. I used Spring Security Rest Plugin for authentication.

I'm implementing a reset password feature, and after the user resets their password, I want to retrieve the JWT token, in order to send it to the Angular app, so the user will not need to authenticate manually.

How can I retrieve the token? Couldn't find it on the plugin docs. The commented line is what I want to achieve:

if(passwordReset?.isValid()){
   passwordReset.password = request.JSON.password
   User user = User.resetPassword(passwordReset)
   springSecurityService.reauthenticate(user.username)
   //springSecurityService.getJwtToken()            
}
0

There are 0 answers