"eladmin-system/vscode:/vscode.git/clone" did not exist on "8cb7dc886f1b56bb331d9a5225f0c66e90655f3e"
Commit 01d1aa97 authored by Zheng Jie's avatar Zheng Jie
Browse files

[代码优化](v2.6):加入第三方系统获取Token的方式

close https://github.com/elunez/eladmin/issues/585
parent 3f129e8e
......@@ -89,7 +89,10 @@ public class AuthorizationController {
new UsernamePasswordAuthenticationToken(authUser.getUsername(), password);
Authentication authentication = authenticationManagerBuilder.getObject().authenticate(authenticationToken);
SecurityContextHolder.getContext().setAuthentication(authentication);
// 生成令牌
// 生成令牌与第三方系统获取令牌方式
// UserDetails userDetails = userDetailsService.loadUserByUsername(userInfo.getUsername());
// Authentication authentication = new UsernamePasswordAuthenticationToken(userDetails, null, userDetails.getAuthorities());
// SecurityContextHolder.getContext().setAuthentication(authentication);
String token = tokenProvider.createToken(authentication);
final JwtUserDto jwtUserDto = (JwtUserDto) authentication.getPrincipal();
// 保存在线信息
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment