diff --git a/yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/controller/AuthController.java b/yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/controller/AuthController.java index 19b07e5b4..fe64a1547 100644 --- a/yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/controller/AuthController.java +++ b/yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/controller/AuthController.java @@ -52,7 +52,7 @@ public class AuthController { */ @PostMapping("/logout") public CommonResult logout(HttpServletRequest request) { - String token = SecurityUtils.obtainAuthorization(request, "Authentication"); + String token = SecurityUtils.obtainAuthorization(request, "Authorization"); if (StrUtil.isNotBlank(token)) { return oauth2Client.revokeToken(token); } diff --git a/yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/framework/core/filter/TokenAuthenticationFilter.java b/yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/framework/core/filter/TokenAuthenticationFilter.java index 106e1bd0d..70bb40eaa 100644 --- a/yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/framework/core/filter/TokenAuthenticationFilter.java +++ b/yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/framework/core/filter/TokenAuthenticationFilter.java @@ -32,7 +32,7 @@ public class TokenAuthenticationFilter extends OncePerRequestFilter { protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { // 1. 获得访问令牌 - String token = SecurityUtils.obtainAuthorization(request, "Authentication"); + String token = SecurityUtils.obtainAuthorization(request, "Authorization"); if (StringUtils.hasText(token)) { // 2. 基于 token 构建登录用户 LoginUser loginUser = buildLoginUserByToken(token); diff --git a/yudao-example/yudao-sso-demo-by-code/src/main/resources/static/callback.html b/yudao-example/yudao-sso-demo-by-code/src/main/resources/static/callback.html index 60199e29e..123a1af9b 100644 --- a/yudao-example/yudao-sso-demo-by-code/src/main/resources/static/callback.html +++ b/yudao-example/yudao-sso-demo-by-code/src/main/resources/static/callback.html @@ -9,8 +9,8 @@ diff --git a/yudao-example/yudao-sso-demo-by-code/src/main/resources/static/index.html b/yudao-example/yudao-sso-demo-by-code/src/main/resources/static/index.html index 9c0dac659..8511b668b 100644 --- a/yudao-example/yudao-sso-demo-by-code/src/main/resources/static/index.html +++ b/yudao-example/yudao-sso-demo-by-code/src/main/resources/static/index.html @@ -8,20 +8,20 @@ - - + + - - + +