java.lang.StackOverflowError: null at org.springframework.aop.support.AopUtils.invokeJoinpointUsing

insert image description here
When implementing Token login based on Spring Security, I encountered the problem shown in the figure above.
①Login->②Get token->③Use token to operate
Step ③An error is reported.
Finally, it was found that the token character was converted into an Authentication object when the front end was passed to the back end.
insert image description here
mistake!

insert image description here
correct!
insert image description here
correct!

I don't know why.

figure 1
This is the code for creating the token in Step 1. It does not matter whether the third parameter is specified or not.
The object obtained in step 1 when it is wrong The object
insert image description here
obtained in step 3 when
insert image description here
it is wrong The object obtained in step 1 when
insert image description here
it is correct The object obtained in step 3
insert image description here
when it is correct The object (new ArrayList()) obtained in
insert image description here
step 1 when it is correct The object obtained by the step (new ArrayList())
insert image description here

Guess you like

Origin blog.csdn.net/weixin_44225096/article/details/126412346