From 6be30c0887117f67cb1cc577c65d7711df1b35a7 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Mon, 3 Oct 2022 17:52:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20yudao-sso-demo-by-code=20?= =?UTF-8?q?=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ssodemo/controller/AuthController.java | 2 +- .../filter/TokenAuthenticationFilter.java | 2 +- .../src/main/resources/static/callback.html | 14 ++--- .../src/main/resources/static/index.html | 52 +++++++++---------- 4 files changed, 35 insertions(+), 35 deletions(-) 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 @@ - - + + - - + +