problem description
after SpringSecurity is authenticated by user name and password, it returns that the validity period of JWT"s token,token is set to 15min, but how do I refresh token, if token does not refresh, then 15min will expire later
the environmental background of the problems and what methods you have tried
every time I request, I will check to see if I can get the authentication information. If I can get the authentication information, I will generate a new token, for the authentication information and put it back in the backlog. This requires the front end to obtain the token from the backlog to update the token, after each request. I have learned about the refresh token, but do not know how to do it in the JWT, because the authentication information is placed in the token. If the token expires, I need to regenerate the token, but how does the front end know when to refine the token
related codes
is mainly a matter of train of thought and flow, and does not involve the specific code
what result do you expect? What is the error message actually seen?
after the frontend requests login, the backend sends a token and refresh token, and then the backend updates the token, frontend according to these two. Just make sure that these two are attached. The expectation is that, as I understand it, the token should exist on the server. How token and refresh token,Spring Security Oauth2 implement token refresh
also exists when access token is returned in Spring Security Oauth2.