OAuth2Authentication authentication=(OAuth2Authentication auth);
System. The out. Println (" 1234 "+ authentication. GetDetails ());
OAuth2AuthenticationDetails oauthDetails=(OAuth2AuthenticationDetails) authentication. GetDetails ();
Map
Return (Map
Detailed error message:
Under Caused by: Java. Lang. ClassCastException: org. Springframework. Security. Authentication. AnonymousAuthenticationToken always be cast to org. Springframework. Security. Oauth2. Provider. OAuth2Authentication
At com. Eastsoft. Substation. Gateway. Util. TokenExtraInfo. GetUserExtraMessage (TokenExtraInfo. Java: 34) ~ (classes/: na)
At com. Eastsoft. Substation. Gateway. Config. LicenseZuulFilter. Run (LicenseZuulFilter. Java: 54) ~ (classes/: na)
At com.net flix. Zuul. ZuulFilter. RunFilter (ZuulFilter. Java: 117) ~ [zuul - core - 1.3.1. The jar: 1.3.1]
At com.net flix. Zuul. FilterProcessor. ProcessZuulFilter (FilterProcessor. Java: 193) ~ [zuul - core - 1.3.1. The jar: 1.3.1]
. 108 common frames omitted
Watch should be under the type conversion error, excuse me, why SecurityContextHolder. GetContext () getAuthentication AnonymousAuthenticationToken is () to get out of? How can I get the OAuth2Authentication?
CodePudding user response:
Error message is positioned to red statement submitted to the faultCodePudding user response:
What's the relationship between OAuth2Authentication and Authentication.CodePudding user response:
OAuth2Authentication is want to by Authentication. GetDetails (), and then turn strong, is the red that sentenceCodePudding user response: